-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDebugCommandBase.cs
More file actions
52 lines (43 loc) · 1.24 KB
/
DebugCommandBase.cs
File metadata and controls
52 lines (43 loc) · 1.24 KB
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
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DebugCommandBase
{
private string _CommandID;
private string _CommandDescription;
private string _CommandFormat;
public string CommandID { get { return _CommandID; } }
public string CommandDescription { get { return _CommandDescription; } }
public string CommandFormat { get { return _CommandFormat; } }
public DebugCommandBase(string id, string description, string format)
{
_CommandID = id;
_CommandDescription = description;
_CommandFormat = format;
}
}
public class DebugCommand : DebugCommandBase
{
private Action command;
public DebugCommand(string id, string description, string format, Action command) : base (id, description, format)
{
this.command = command;
}
public void Invoke()
{
command.Invoke();
}
}
public class DebugCommand<T1> : DebugCommandBase
{
private Action<T1> command;
public DebugCommand(string id, string description, string format, Action<T1> command) : base (id, description, format)
{
this.command = command;
}
public void Invoke(T1 value)
{
command.Invoke(value);
}
}