From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/AI/AIRunTimeBoolComparison.cs | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/AI/AIRunTimeBoolComparison.cs (limited to 'Client/Assets/Scripts/XMainClient/AI/AIRunTimeBoolComparison.cs') diff --git a/Client/Assets/Scripts/XMainClient/AI/AIRunTimeBoolComparison.cs b/Client/Assets/Scripts/XMainClient/AI/AIRunTimeBoolComparison.cs new file mode 100644 index 00000000..d84db026 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/AI/AIRunTimeBoolComparison.cs @@ -0,0 +1,31 @@ +using System; +using System.Xml; + +namespace XMainClient +{ + internal class AIRunTimeBoolComparison : AIRunTimeNodeAction + { + private string _bool_name1; + + private bool _bool_value1; + + private string _bool_name2; + + private bool _bool_value2; + + public AIRunTimeBoolComparison(XmlElement node) : base(node) + { + this._bool_name1 = node.GetAttribute("Shared_Bool1Name"); + this._bool_value1 = (node.GetAttribute("bool1Value") != "0"); + this._bool_name2 = node.GetAttribute("Shared_Bool2Name"); + this._bool_value2 = (node.GetAttribute("bool2Value") != "0"); + } + + public override bool Update(XEntity entity) + { + bool boolByName = entity.AI.AIData.GetBoolByName(this._bool_name1, this._bool_value1); + bool boolByName2 = entity.AI.AIData.GetBoolByName(this._bool_name2, this._bool_value2); + return boolByName == boolByName2; + } + } +} -- cgit v1.1-26-g67d0