1
//
2
3
4
using System;
5
using System.Collections.Generic;
6
using System.Runtime.Serialization;
7
8
namespace SharpLib.Ear
9
{
10
[DataContract]
11
public abstract class MEvent
12
13
public string Name { get; protected set; }
14
public string Description { get; protected set; }
15
16
public abstract void Trigger();
17
};
18
19
20
public abstract class Event : MEvent
21
22
[DataMember]
23
public List<Action> Actions = new List<Action>();
24
25
protected Event()
26
27
28
}
29
30
public override void Trigger()
31
32
Console.WriteLine("Event triggered: " + Name);
33
foreach (Action action in Actions)
34
35
action.Execute();
36
37
38
39
40