From 43f8ce08706629e69984b1cc34e5e979d03ef09a Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Mon, 23 Jun 2014 21:12:57 +0200 Subject: [PATCH] Add props.compileCondition to actually use exposed SGCondition. --- Nasal/props.nas | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Nasal/props.nas b/Nasal/props.nas index 4d58d3f2c..c0679c6d4 100644 --- a/Nasal/props.nas +++ b/Nasal/props.nas @@ -281,6 +281,19 @@ var nodeList = func { return list; } +## +# Compiles a 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 property branch according to the rules # set out in $FG_ROOT/Docs/README.conditions. Undefined conditions