1
0
Fork 0

Add props.compileCondition to actually use exposed SGCondition.

This commit is contained in:
Thomas Geymayer 2014-06-23 21:12:57 +02:00
parent 4b00bb3067
commit 43f8ce0870

View file

@ -281,6 +281,19 @@ var nodeList = func {
return list; return list;
} }
##
# Compiles a <condition> property branch according to the rules
# set out in $FG_ROOT/Docs/README.conditions into a Condition object.
# The 'test' method of the returend object can be used to evaluate
# the condition.
# The function returns nil on error.
#
var compileCondition = func(p) {
if(p == nil) return nil;
if(!isa(p, Node)) p = props.globals.getNode(p);
return _createCondition(p._g);
}
## ##
# Evaluates a <condition> property branch according to the rules # Evaluates a <condition> property branch according to the rules
# set out in $FG_ROOT/Docs/README.conditions. Undefined conditions # set out in $FG_ROOT/Docs/README.conditions. Undefined conditions