author | StephaneLenclud |
Sat, 23 Jul 2016 19:22:56 +0200 | |
changeset 211 | 96f8b4dc4300 |
child 212 | 1a0791daa243 |
permissions | -rw-r--r-- |
1 //
4 using System;
5 using System.Collections.Generic;
6 using System.Runtime.Serialization;
8 namespace SharpLib.Ear
9 {
10 [DataContract]
11 public abstract class MEvent
12 {
13 [DataMember]
14 public string Name { get; protected set; }
16 [DataMember]
17 public string Description { get; protected set; }
19 public abstract void Trigger();
20 };
22 [DataContract]
23 public abstract class Event : MEvent
24 {
25 public List<Action> Actions;
27 protected Event()
28 {
29 Actions = new List<Action>();
30 }
32 public override void Trigger()
33 {
34 Console.WriteLine("Event '" + Name + "' triggered.");
35 foreach (Action action in Actions)
36 {
37 action.Execute();
38 }
39 }
40 }
42 }