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
[DataMember]
14
public string Name { get; protected set; }
15
16
17
public string Description { get; protected set; }
18
19
public abstract void Trigger();
20
};
21
22
23
public abstract class Event : MEvent
24
25
public List<Action> Actions;
26
27
protected Event()
28
29
Actions = new List<Action>();
30
}
31
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
41
42