forked from Bastion/Bastion
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
423 B
24 lines
423 B
---@class SpellTrait
|
|
local SpellTrait = {
|
|
func = nil,
|
|
}
|
|
|
|
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
|
|
|