summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XUtliPoolLib/XCallCommand.cs
blob: 9feea104d6a9a0a4d0f124a91a95d9d80c4a15ab (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
using System;

namespace XUtliPoolLib
{
	public class XCallCommand
	{
		public static ExecuteCommandHandler handler = new ExecuteCommandHandler(XCallCommand.Execute);

		public static DebugHandler debugHandler = new DebugHandler(XCallCommand.DebugString);

		public static void DebugString(XGameObject gameObject, XEngineCommand command, string str, int id)
		{
			bool flag = command.data != null;
			if (flag)
			{
				XSingleton<XDebug>.singleton.AddWarningLog2("[EngineCommand] CallCmd {0} ID:{1} data:{2} location:{3} objID:{4}", new object[]
				{
					str,
					id,
					command.data.data,
					gameObject.m_Location,
					gameObject.objID
				});
			}
		}

		public static void Execute(XGameObject gameObject, XEngineCommand command)
		{
			bool flag = command.data != null && command.data.commandCb != null;
			if (flag)
			{
				command.data.commandCb(gameObject, command.data.data, command.commandID);
			}
		}
	}
}