diff options
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/AI/AIRunTimeConditionalEvaluator.cs')
-rw-r--r-- | Client/Assets/Scripts/XMainClient/AI/AIRunTimeConditionalEvaluator.cs | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/AI/AIRunTimeConditionalEvaluator.cs b/Client/Assets/Scripts/XMainClient/AI/AIRunTimeConditionalEvaluator.cs new file mode 100644 index 00000000..2a657e57 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/AI/AIRunTimeConditionalEvaluator.cs @@ -0,0 +1,67 @@ +using System;
+using System.Xml;
+using XUtliPoolLib;
+
+namespace XMainClient
+{
+ internal class AIRunTimeConditionalEvaluator : AIRunTimeDecorationNode
+ {
+ public string ConditionNodeName
+ {
+ get
+ {
+ return this._condition_node_name;
+ }
+ }
+
+ private string _condition_node_name;
+
+ private AIRunTimeNodeBase _condition_node;
+
+ public AIRunTimeConditionalEvaluator(XmlElement node) : base(node)
+ {
+ this._condition_node_name = node.GetAttribute("ConditionalTask");
+ }
+
+ public bool AddConditionNode(AIRunTimeNodeBase node)
+ {
+ bool flag = this._condition_node != null;
+ bool result;
+ if (flag)
+ {
+ XSingleton<XDebug>.singleton.AddErrorLog("ConditionNode already contain condition node", null, null, null, null, null);
+ result = false;
+ }
+ else
+ {
+ this._condition_node = node;
+ result = true;
+ }
+ return result;
+ }
+
+ public override bool Update(XEntity entity)
+ {
+ bool flag = this._condition_node != null;
+ bool result;
+ if (flag)
+ {
+ bool flag2 = !this._condition_node.Update(entity);
+ if (flag2)
+ {
+ result = false;
+ }
+ else
+ {
+ bool flag3 = this._child_node != null;
+ result = (flag3 && this._child_node.Update(entity));
+ }
+ }
+ else
+ {
+ result = false;
+ }
+ return result;
+ }
+ }
+}
|