1 APLTrait
4n0n edited this page 3 years ago

APLTraits are special micro-optimized logic containers which isolate rotation logic and hoist it to the top of an APL evaluation, caching it per APL execution to try and mitigate unneeded repetitive code.

function APLTrait:New(cb)
function APLTrait:Evaluate()
function APLTrait:__tostring()
local Facing = function(t)
    return Bastion.APLTrait:New(function()
        return Player:IsFacing(t)
    end)
end

local HealthOverHalf = Bastion.APLTrait:New(function() return Player:GetHP() > 50 end)

APLActor APL