summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/AI/AIRunTimeCompareTo.cs
blob: 5724d62614c416ec853d6820205bb11256827dfa (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Xml;

namespace XMainClient
{
	internal class AIRunTimeCompareTo : AIRunTimeNodeAction
	{
		private string _first_string_name;

		private string _first_string_value;

		private string _second_string_name;

		private string _second_string_value;

		private string _store_result_name;

		public AIRunTimeCompareTo(XmlElement node) : base(node)
		{
			this._first_string_name = node.GetAttribute("Shared_FirstStringName");
			this._first_string_value = node.GetAttribute("firstString");
			this._second_string_name = node.GetAttribute("Shared_SecondStringName");
			this._second_string_value = node.GetAttribute("secondString");
			this._store_result_name = node.GetAttribute("Shared_ResultName");
		}

		public override bool Update(XEntity entity)
		{
			string stringByName = entity.AI.AIData.GetStringByName(this._first_string_name, this._first_string_value);
			string stringByName2 = entity.AI.AIData.GetStringByName(this._second_string_name, this._second_string_value);
			int num = stringByName.CompareTo(stringByName2);
			bool flag = num > 0;
			int para;
			if (flag)
			{
				para = 1;
			}
			else
			{
				bool flag2 = num < 0;
				if (flag2)
				{
					para = -1;
				}
				else
				{
					para = 0;
				}
			}
			entity.AI.AIData.SetIntByName(this._store_result_name, para);
			return true;
		}
	}
}