2004-10-07 21:35:08 +02:00
|
|
|
// 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
|
|
|
|
|
2004-10-23 16:39:28 +02:00
|
|
|
#include "scripting/DOMEvent.h"
|
2004-11-11 08:09:32 +01:00
|
|
|
#include "Vector3D.h"
|
|
|
|
|
|
|
|
class CDamageType;
|
2004-10-23 16:39:28 +02:00
|
|
|
|
|
|
|
class CEventInitialize : public CScriptEvent
|
|
|
|
{
|
2004-11-11 08:09:32 +01:00
|
|
|
public:
|
2005-04-22 09:12:55 +02:00
|
|
|
CEventInitialize() : CScriptEvent( L"initialize", EVENT_INITIALIZE, false ) {}
|
2004-10-23 16:39:28 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class CEventTick : public CScriptEvent
|
|
|
|
{
|
2004-11-11 08:09:32 +01:00
|
|
|
public:
|
2005-04-22 09:12:55 +02:00
|
|
|
CEventTick() : CScriptEvent( L"tick", EVENT_TICK, false ) {}
|
2004-11-11 08:09:32 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class CEventAttack : public CScriptEvent
|
|
|
|
{
|
|
|
|
CEntity* m_target;
|
|
|
|
public:
|
|
|
|
CEventAttack( CEntity* target );
|
|
|
|
};
|
|
|
|
|
2005-04-15 06:23:33 +02:00
|
|
|
class CEventGather : public CScriptEvent
|
|
|
|
{
|
|
|
|
CEntity* m_target;
|
|
|
|
public:
|
|
|
|
CEventGather( CEntity* target );
|
|
|
|
};
|
|
|
|
|
2004-11-11 08:09:32 +01:00
|
|
|
class CEventDamage : public CScriptEvent
|
|
|
|
{
|
|
|
|
CEntity* m_inflictor;
|
|
|
|
CDamageType* m_damage;
|
|
|
|
public:
|
|
|
|
CEventDamage( CEntity* inflictor, CDamageType* damage );
|
|
|
|
};
|
|
|
|
|
|
|
|
class CEventTargetChanged : public CScriptEvent
|
|
|
|
{
|
|
|
|
CEntity* m_target;
|
|
|
|
public:
|
|
|
|
int m_defaultAction;
|
2005-04-22 09:12:55 +02:00
|
|
|
CStrW m_defaultCursor;
|
2004-11-11 08:09:32 +01:00
|
|
|
CEventTargetChanged( CEntity* target );
|
|
|
|
};
|
|
|
|
|
|
|
|
class CEventPrepareOrder : public CScriptEvent
|
|
|
|
{
|
|
|
|
CEntity* m_target;
|
|
|
|
int m_orderType;
|
|
|
|
public:
|
|
|
|
CEventPrepareOrder( CEntity* target, int orderType );
|
2004-10-23 16:39:28 +02:00
|
|
|
};
|
|
|
|
|
2004-11-15 23:30:01 +01:00
|
|
|
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 );
|
|
|
|
};
|
|
|
|
|
2004-11-07 22:30:47 +01:00
|
|
|
#endif
|