-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathIEntity.cs
50 lines (36 loc) · 1.26 KB
/
IEntity.cs
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
// IEntity.cs
// Created by Aaron C Gaudette on 25.04.17
using System.Collections.Generic;
namespace BehaviorEngine {
public interface IEntity : Debug.ILabeled {
IRepository Repository { get; set; }
IAttributeInstance this[IAttribute prototype] { get; }
ICollection<IAttributeInstance> GetAttributeInstances();
bool AddAttribute(IAttribute prototype);
bool RemoveAttribute(IAttribute prototype);
void Subscribe();
void Poll();
void React(Interaction interaction, IEntity host);
void Observe(
Interaction interaction, IEntity host, ICollection<IEntity> targets
);
event EntityEvents.OnReactEventHandler OnReact;
event EntityEvents.OnObserveEventHandler OnObserve;
event EntityEvents.OnPollEventHandler OnPoll;
}
public static class EntityEvents {
public delegate void OnReactEventHandler(
object sender,
Interaction interaction, IEntity host, IList<Effect> effects
);
public delegate void OnObserveEventHandler(
object sender,
Interaction interaction, IEntity host,
ICollection<IEntity> targets, IList<Effect> effects
);
public delegate void OnPollEventHandler(
object sender,
Interaction choice, ICollection<IEntity> targets, float highscore
);
}
}