1
0
forked from 0ad/0ad
0ad/source/simulation/EventHandlers.h

77 lines
1.8 KiB
C
Raw Normal View History

// List of event handlers (for entities) the engine will call in to.
// Using integer tags should be ever-so-slightly faster than the hashmap lookup
// Also allows events to be renamed without affecting other code.
#ifndef EVENT_HANDLERS_INCLUDED
#define EVENT_HANDLERS_INCLUDED
#include "scripting/DOMEvent.h"
#include "Vector3D.h"
#include "EntityOrders.h"
class CEventInitialize : public CScriptEvent
{
public:
CEventInitialize() : CScriptEvent( L"initialize", EVENT_INITIALIZE, false ) {}
};
class CEventTick : public CScriptEvent
{
public:
CEventTick() : CScriptEvent( L"tick", EVENT_TICK, false ) {}
};
class CEventGeneric : public CScriptEvent
{
CEntity* m_target;
int m_action;
public:
CEventGeneric( CEntity* target, int m_action );
};
class CEventTargetChanged : public CScriptEvent
{
CEntity* m_target;
public:
int m_defaultOrder;
int m_defaultAction;
CStrW m_defaultCursor;
CStrW m_secondaryCursor;
int m_secondaryOrder;
int m_secondaryAction;
CEventTargetChanged( CEntity* target );
};
class CEventPrepareOrder : public CScriptEvent
{
CEntity* m_target;
int m_orderType;
public:
2006-02-13 04:32:15 +01:00
CEntity* m_notifySource;
int m_notifyType;
int m_action;
CEventPrepareOrder( CEntity* target, int orderType, int action );
};
class CEventOrderTransition : public CScriptEvent
{
int m_orderPrevious;
int m_orderCurrent;
CEntity** m_target;
CVector3D* m_worldPosition;
public:
CEventOrderTransition( int orderPrevious, int orderCurrent, CEntity*& target, CVector3D& worldPosition );
};
class CEventNotification : public CScriptEvent
{
//Same as CEntityOrder data for support of all orders
CEntity* m_target;
2006-02-13 04:32:15 +01:00
int m_action; //u64 is unsupported...will this work?
int m_notifyType;
CVector3D m_location; //No real use for y, but CVector2D unsupported
public:
2006-02-13 04:32:15 +01:00
CEventNotification( CEntityOrder order, int notifyType );
};
#endif