Support "casting" the return value of custom functions into constants.
Support "casting" the return value of custom functions into constants.
A custom function is one that is defined by AddFunction. If the function
is defined as:
AddFunction FuncName asValue=1 { ... }
then the function is evaluated normally, then typecast to a constant as
follows:
(1) If the return value is a time span (a "boolean" value), then if the
current time of the simulation is within the time span, then return 1,
or 0 otherwise.
(2) If the return value is a linear function, then if the current time of
the simulation is within the function's domain, then the function is
simply evaluated at the current time, or 0 otherwise.
(3) If the return value is an action, then return 1 if the action is off
of cooldown, or 0 if it is on cooldown.
git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1080 d5049fe3-3747-40f7-a4b5-f36d6801af5f