00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #if !defined(_XRB_ENGINE2_EVENTS_HPP_)
00012 #define _XRB_ENGINE2_EVENTS_HPP_
00013
00014 #include "xrb_event.hpp"
00015
00016 namespace Xrb
00017 {
00018
00019 namespace Engine2
00020 {
00021
00022 class Entity;
00023 class ObjectLayer;
00024
00025 bool MatchEntity (Event const *event, Entity *entity_to_match);
00026
00027 class EventEntity : public Event
00028 {
00029 public:
00030
00031 EventEntity (Entity *entity, Float time, EventType event_type)
00032 :
00033 Event(time, event_type)
00034 {
00035 ASSERT1(entity != NULL);
00036 m_entity = entity;
00037 }
00038 virtual ~EventEntity () { }
00039
00040 inline Entity *GetEntity () const { return m_entity; }
00041
00042 inline void NullifyEntity () const
00043 {
00044 ASSERT1(m_entity != NULL);
00045 m_entity = NULL;
00046 }
00047
00048 private:
00049
00050 mutable Entity *m_entity;
00051 };
00052
00053 }
00054
00055 }
00056
00057 #endif // !defined(_XRB_ENGINE2_EVENTS_HPP_)
00058