Quantcast

Support "casting" the return value of custom functions into constants.

Author Johnny C. Lam <jlam88@gmail.com>
Author date 2013-10-19 07:54:17
Author local date 2013-10-19 07:54:17 +0000
Committer Johnny C. Lam <jlam88@gmail.com>
Committer date 2013-10-19 07:54:17
Committer local date 2013-10-19 07:54:17 +0000
Commit 88a3719289c888ce9b8cbe4584cac783bcf6489f
Tree 90c07dbdcb28b9b23ecfdd01f9ad1e26e1b76300
Parent ef41cfd978bb863ac5035ec654e57941929db8e5
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