YAPOG  0.0.1
Yet Another Pokemon Online Game
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"
6 # include "YAPOG/Collection/Map.hpp"
7 # include "YAPOG/Collection/Set.hpp"
12 
13 namespace yap
14 {
15  class DynamicWorldObject;
16  class MapEventContext;
17  class BoundingBox;
18  class CollidableArea;
19 
21  {
23 
24  typedef collection::Map<
25  MapEvent*,
30  typedef collection::Map<
31  const DynamicWorldObject*,
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 
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 
74 
76 
78 
80  };
81 } // namespace yap
82 
83 #endif // YAPOG_MAPEVENTMANAGER_HPP