forked from Dzejrou/tdt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEventHelper.hpp
More file actions
93 lines (82 loc) · 2.56 KB
/
Copy pathEventHelper.hpp
File metadata and controls
93 lines (82 loc) · 2.56 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#pragma once
#include <Ogre.h>
#include <cstdlib>
#include "Enums.hpp"
class EntitySystem;
/**
* Auxiliary namespace containing functions that help with the management of
* the event component.
*/
namespace EventHelper
{
/**
* Brief: Sets the type of a given event.
* Param: Entity system that contains the entity.
* Param: ID of the event.
* Param: The new type.
*/
void set_event_type(EntitySystem&, std::size_t, EVENT_TYPE);
/**
* Brief: Returns the type of a given event.
* Param: Entity system that contains the entity.
* Param: ID of the event.
*/
EVENT_TYPE get_event_type(EntitySystem&, std::size_t);
/**
* Brief: Sets the target entity (the subject of the event) of
* a given event.
* Param: Entity system that contains the entity.
* Param: ID of the event.
* Param: ID of the target.
*/
void set_target(EntitySystem&, std::size_t, std::size_t);
/**
* Brief: Returns the target entity (the subject of the event) of
* a given event.
* Param: Entity system that contains the entity.
* Param: ID of the event.
*/
std::size_t get_target(EntitySystem&, std::size_t);
/**
* Brief: Sets the radius handlers have to be in in order to be
* able to handle a given event.
* Param: Entity system that contains the entity.
* Param: ID of the event.
* Param: The new radius.
*/
void set_radius(EntitySystem&, std::size_t, Ogre::Real);
/**
* Brief: Returns the radius handlers have to be in in order to be
* able to handle a given event.
* Param: Entity system that contains the entity.
* Param: ID of the event.
*/
Ogre::Real get_radius(EntitySystem&, std::size_t);
/**
* Brief: Sets the activity state of a given event.
* Param: Entity system that contains the entity.
* Param: ID of the event.
* Param: ID for active, false for inactive.
*/
void set_active(EntitySystem&, std::size_t, bool = true);
/**
* Brief: Returns true if a given event is active,
* false otherwise.
* Param: Entity system that contains the entity.
* Param: ID of the event.
*/
bool is_active(EntitySystem&, std::size_t);
/**
* Brief: Sets the entity that handles a given event.
* Param: Entity system containing both the entity and the event.
* Param: ID of the event.
* Param: ID of the handling entity.
*/
void set_event_handler(EntitySystem&, std::size_t, std::size_t);
/**
* Brief: Returns the entity that handles a given event.
* Param: Entity system containing both the entity and the event.
* Param: ID of the event.
*/
std::size_t get_event_handler(EntitySystem&, std::size_t);
}