Add user action evaluator: Object exists

qteditor
Sven Eberhardt 2016-07-30 17:47:45 -04:00
parent a01c6d4db9
commit 8bc310c52a
3 changed files with 7 additions and 0 deletions

View File

@ -156,6 +156,7 @@ func Definition(def)
] },
RightOperand = new Evaluator.Player { Name="$RightOperand$", EditorHelp="$RightOperandHelp$" }
} } );
AddEvaluator("Boolean", nil, "$ObjectExists$", "$ObjectExistsHelp$", "object_exists", [def, def.EvalBool_ObjectExists], { }, new Evaluator.Object { }, "Object");
// Integer evaluators
AddEvaluator("Integer", nil, ["$Constant$", ""], "$ConstantHelp$", "int_constant", [def, def.EvalConstant], { Value=0 }, { Type="int", Name="$Value$" });
AddEvaluator("Integer", nil, "$Random$", "$RandomIntHelp$", "int_random", [def, def.EvalIntRandom], { Min={Function="int_constant", Value=0}, Max={Function="int_constant", Value=99} }, { Type="proplist", Display="Rnd({{Min}}..{{Max}})", EditorProps = {
@ -418,6 +419,8 @@ private func EvalComparison(proplist props, proplist context, data_type)
return left >= right;
}
private func EvalBool_ObjectExists(proplist props, proplist context) { return !!EvaluateValue("Object", props.Object, context); }
private func EvalAct_Sequence(proplist props, proplist context)
{
// Sequence execution: Iterate over actions until one action puts the context on hold

View File

@ -173,3 +173,5 @@ CompareObject=Vergleiche Objekte
CompareString=Vergleiche Texte
CompareDefinition=Vergleiche Objekttypen
ComparePlayer=Vergleiche Spieler
ObjectExists=Objekt existiert
ObjectExistsHelp=Wahr, wenn das die Funktion ein Objekt zurueckgibt.

View File

@ -173,3 +173,5 @@ CompareObject=Compare objects
CompareString=Compare texts
CompareDefinition=Compare object types
ComparePlayer=Compare players
ObjectExists=Object exists
ObjectExistsHelp=True if the function returns an object.