YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
MapEventManager.hpp
Go to the documentation of this file.
1
#ifndef YAPOG_MAPEVENTMANAGER_HPP
2
# define YAPOG_MAPEVENTMANAGER_HPP
3
4
# include "
YAPOG/Macros.hpp
"
5
# include "
YAPOG/Game/IUpdateable.hpp
"
6
# include "
YAPOG/Collection/Map.hpp
"
7
# include "
YAPOG/Collection/Set.hpp
"
8
# include "
YAPOG/Game/World/Map/MapEventContextTriggerComparator.hpp
"
9
# include "
YAPOG/Game/World/Map/MapEvent.hpp
"
10
# include "
YAPOG/Collection/Queue.hpp
"
11
# include "
YAPOG/System/Event/Event.hpp
"
12
13
namespace
yap
14
{
15
class
DynamicWorldObject;
16
class
MapEventContext;
17
class
BoundingBox;
18
class
CollidableArea;
19
20
class
YAPOG_LIB
MapEventManager
:
public
IUpdateable
21
{
22
DISALLOW_COPY
(
MapEventManager
);
23
24
typedef
collection::Map
<
25
MapEvent
*,
26
collection::Set
<
27
MapEventContext
*,
28
MapEventContextTriggerComparator
>>
EventTriggeringType
;
30
typedef
collection::Map
<
31
const
DynamicWorldObject
*,
32
EventTriggeringType
>
ObjectEventsType
;
33
34
public
:
35
36
MapEventManager
();
37
~
MapEventManager
();
38
39
void
SetCollidableArea (
CollidableArea
* collidableArea);
40
41
void
UpdateObject (
DynamicWorldObject
&
object
);
42
void
RemoveObject (
const
DynamicWorldObject
&
object
);
43
46
virtual
void
Update (
const
Time
& dt);
48
49
yap::Event<MapEventManager&>
OnEventsAborted
;
50
51
private
:
52
53
bool
AddEventEntry (
MapEventContext
* eventContext);
54
bool
RemoveEventEntry (
MapEventContext
* eventContext);
55
56
void
UpdateObjectOut (
const
DynamicWorldObject
&
object
);
57
void
UpdateObjectIn (
DynamicWorldObject
&
object
);
58
59
void
AddLeaveEvent (
MapEventContext
* event);
60
void
AddEnterEvent (
MapEventContext
* event);
61
62
void
CallEvents (
const
Time
& dt);
63
64
bool
CallEvent (
65
MapEventActionType
type,
66
const
Time
& dt,
67
MapEventContext
& eventContext);
68
69
void
AbortEvents ();
70
71
ObjectEventsType
events_
;
72
collection::Queue<MapEventContext*>
leaveEvents_
;
73
collection::Queue<MapEventContext*>
enterEvents_
;
74
75
collection::Queue<const DynamicWorldObject*>
objectsToRemove_
;
76
77
CollidableArea
*
collidableArea_
;
78
79
bool
abortEvents_
;
80
};
81
}
// namespace yap
82
83
#endif // YAPOG_MAPEVENTMANAGER_HPP
YAPOG
include
YAPOG
Game
World
Map
MapEventManager.hpp
Generated on Mon Sep 17 2012 22:24:23 for YAPOG by
1.8.1.1