forked from 0ad/0ad
33 lines
1.0 KiB
C++
33 lines
1.0 KiB
C++
|
#include "precompiled.h"
|
||
|
#include "EventHandlers.h"
|
||
|
#include "Entity.h"
|
||
|
|
||
|
CEventAttack::CEventAttack( CEntity* target ) : CScriptEvent( L"attack", true, EVENT_ATTACK )
|
||
|
{
|
||
|
m_target = target;
|
||
|
AddProperty( L"target", &m_target );
|
||
|
}
|
||
|
|
||
|
CEventDamage::CEventDamage( CEntity* inflictor, CDamageType* damage ) : CScriptEvent( L"takesDamage", true, EVENT_DAMAGE )
|
||
|
{
|
||
|
m_inflictor = inflictor;
|
||
|
m_damage = damage;
|
||
|
AddReadOnlyProperty( L"inflictor", &m_inflictor );
|
||
|
AddProperty( L"damage", &m_damage );
|
||
|
}
|
||
|
|
||
|
CEventTargetChanged::CEventTargetChanged( CEntity* target ) : CScriptEvent( L"targetChanged", false, EVENT_TARGET_CHANGED )
|
||
|
{
|
||
|
m_target = target;
|
||
|
m_defaultAction = -1;
|
||
|
AddReadOnlyProperty( L"target", &m_target );
|
||
|
AddProperty( L"defaultAction", &m_defaultAction );
|
||
|
}
|
||
|
|
||
|
CEventPrepareOrder::CEventPrepareOrder( CEntity* target, int orderType ) : CScriptEvent( L"prepareOrder", true, EVENT_PREPARE_ORDER )
|
||
|
{
|
||
|
m_target = target;
|
||
|
m_orderType = orderType;
|
||
|
AddReadOnlyProperty( L"target", &m_target );
|
||
|
AddReadOnlyProperty( L"orderType", &m_orderType );
|
||
|
}
|