DragonNest/GameCommon/DnPropStateCmdOperation.cpp
2024-12-20 16:56:44 +08:00

60 lines
2.9 KiB
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "StdAfx.h"
#include "DnPropStateCmdOperation.h"
#include "DnWorldActProp.h"
CDnPropStateCmdOperation::CDnPropStateCmdOperation( DnPropHandle hEntity ) : CDnPropState( hEntity )
{
m_iType = CMD_OPERATION;
m_iOperateIDToSend = 0;
}
CDnPropStateCmdOperation::~CDnPropStateCmdOperation(void)
{
}
bool CDnPropStateCmdOperation::OnEntry( LOCAL_TIME LocalTime, float fDelta )
{
CDnPropState::OnEntry( LocalTime, fDelta );
if( !m_hEntity )
return false;
CDnWorldActProp* pActProp = static_cast<CDnWorldActProp*>(m_hEntity.GetPointer());
if( NULL == pActProp )
{
#ifdef ENABLE_PROP_STATE_LOG
OutputDebug( "[?? Prop FSM Log] CDnPropStateCmdOperation::OnEntry Entity Prop is NULL!\n" );
#endif
return false;
}
pActProp->CmdOperation( m_iOperateIDToSend );
#ifdef _DEBUG
OutputDebug( "[Prop(%d) FSM Log] CDnPropStateCmdOperation::OnEntry (Send Operate ID:%d)\n", m_hEntity->GetUniqueID(), m_iOperateIDToSend );
#endif
return true;
}
bool CDnPropStateCmdOperation::OnProcess( LOCAL_TIME LocalTime, float fDelta )
{
CDnPropState::OnProcess( LocalTime, fDelta );
return true;
}
bool CDnPropStateCmdOperation::OnLeave( LOCAL_TIME LocalTime, float fDelta )
{
CDnPropState::OnLeave( LocalTime, fDelta );
#ifdef ENABLE_PROP_STATE_LOG
OutputDebug( "[Prop(%d) FSM Log] CDnPropStateCmdOperation::OnLeave (Send Operate ID:%d)\n", m_hEntity->GetUniqueID(), m_iOperateIDToSend );
#endif
return true;
}