diff options
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/AI/AIRunTimeBoolComparison.cs')
-rw-r--r-- | Client/Assets/Scripts/XMainClient/AI/AIRunTimeBoolComparison.cs | 31 |
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;
+ }
+ }
+}
|