From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../AI/AIRunTimeConditionalEvaluator.cs | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/AI/AIRunTimeConditionalEvaluator.cs (limited to 'Client/Assets/Scripts/XMainClient/AI/AIRunTimeConditionalEvaluator.cs') 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.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; + } + } +} -- cgit v1.1-26-g67d0