summaryrefslogtreecommitdiff
path: root/WorldlineKeepers/Assets/Scripts/Tools/Commands/Command.cs
diff options
context:
space:
mode:
Diffstat (limited to 'WorldlineKeepers/Assets/Scripts/Tools/Commands/Command.cs')
-rw-r--r--WorldlineKeepers/Assets/Scripts/Tools/Commands/Command.cs47
1 files changed, 47 insertions, 0 deletions
diff --git a/WorldlineKeepers/Assets/Scripts/Tools/Commands/Command.cs b/WorldlineKeepers/Assets/Scripts/Tools/Commands/Command.cs
new file mode 100644
index 0000000..120eb08
--- /dev/null
+++ b/WorldlineKeepers/Assets/Scripts/Tools/Commands/Command.cs
@@ -0,0 +1,47 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace WK
+{
+
+ public abstract class Command
+ {
+
+ public abstract void Execute();
+
+ }
+
+ public class CommandList
+ {
+ private List<Command> m_Commands = new List<Command>();
+
+ public void AddCommand(Command cmd)
+ {
+ if (cmd == null)
+ {
+ return;
+ }
+ m_Commands.Add(cmd);
+ }
+
+ public void RemoveCommand(Command cmd)
+ {
+ if (cmd == null)
+ {
+ return;
+ }
+ m_Commands.Remove(cmd);
+ }
+
+ public void Execute()
+ {
+ for (int i = 0; i < m_Commands.Count; ++i)
+ {
+ m_Commands[i].Execute();
+ }
+ }
+
+ }
+
+}