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

59 lines
No EOL
3 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 "DnWorldProp.h"
#include "DnPropStateScanActor.h"
#include "SMScanActor.h"
#include "boost/shared_ptr.hpp"
CDnPropStateScanActor::CDnPropStateScanActor( DnPropHandle hEntity ) : CDnPropState( hEntity ),
m_fScanRange( 0.0f )
{
m_iType = SCAN_ACTOR;
}
CDnPropStateScanActor::~CDnPropStateScanActor(void)
{
}
bool CDnPropStateScanActor::OnEntry( LOCAL_TIME LocalTime, float fDelta )
{
CDnPropState::OnEntry( LocalTime, fDelta );
#ifdef _DEBUG
OutputDebug( "[Prop(%d) FSM Log] CDnPropStateScanActor::OnEntry\n", m_hEntity->GetUniqueID() );
#endif
return true;
}
bool CDnPropStateScanActor::OnProcess( LOCAL_TIME LocalTime, float fDelta )
{
CDnPropState::OnProcess( LocalTime, fDelta );
if( 0.0f == m_fScanRange )
return false;
DNVector(DnActorHandle) vlhScanResult;
CDnActor::ScanActor( m_hEntity->GetRoom(), m_hEntity->GetMatEx()->m_vPosition, m_fScanRange, vlhScanResult );
//if( false == vlhScanResult.empty() )
//{
// delete 는 shared_ptr 이 알아서 해줌.
boost::shared_ptr<IStateMessage> pScanActorMsg = boost::shared_ptr<IStateMessage>(new CSMScanActor( vlhScanResult ));
m_hEntity->OnMessage( pScanActorMsg );
//}
return true;
}
bool CDnPropStateScanActor::OnLeave( LOCAL_TIME LocalTime, float fDelta )
{
CDnPropState::OnLeave( LocalTime, fDelta );
#ifdef _DEBUG
OutputDebug( "[Prop(%d) FSM Log] CDnPropStateScanActor::OnLeave\n", m_hEntity->GetUniqueID() );
#endif
return true;
}