summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/AI/AIRunTimeBoolComparison.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-01-25 14:28:30 +0800
committerchai <chaifix@163.com>2021-01-25 14:28:30 +0800
commit6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch)
tree7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/AI/AIRunTimeBoolComparison.cs
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/AI/AIRunTimeBoolComparison.cs')
-rw-r--r--Client/Assets/Scripts/XMainClient/AI/AIRunTimeBoolComparison.cs31
1 files changed, 31 insertions, 0 deletions
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;
+ }
+ }
+}