forked from Bastion/Bastion
				
			
							parent
							
								
									c0c8ab8362
								
							
						
					
					
						commit
						ae7d2091d5
					
				@ -0,0 +1,23 @@ | 
				
			|||||||
 | 
					local Tinkr, Bastion = ... | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---@class SpellTrait | 
				
			||||||
 | 
					local SpellTrait = {} | 
				
			||||||
 | 
					SpellTrait.__index = SpellTrait | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Constructor | 
				
			||||||
 | 
					---@param func function | 
				
			||||||
 | 
					---@return SpellTrait | 
				
			||||||
 | 
					function SpellTrait:New(func) | 
				
			||||||
 | 
					    local self = setmetatable({}, SpellTrait) | 
				
			||||||
 | 
					    self.func = func | 
				
			||||||
 | 
					    return self | 
				
			||||||
 | 
					end | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Evaluate the trait | 
				
			||||||
 | 
					---@param spell Spell | 
				
			||||||
 | 
					---@return boolean | 
				
			||||||
 | 
					function SpellTrait:Evaluate(spell) | 
				
			||||||
 | 
					    return self.func(spell) | 
				
			||||||
 | 
					end | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					return SpellTrait | 
				
			||||||
					Loading…
					
					
				
		Reference in new issue