summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/AI/AIRunTimeBoolComparison.cs
blob: d84db02612ba4ffd48953d8165e174d8a1442da2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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;
		}
	}
}