Files
Leviathan/Client/Game/game/Player/SPetStateMachine.h
T
2026-06-01 12:46:52 +02:00

73 lines
2.5 KiB
Objective-C

#pragma once
#include "SStateMachine.h"
// sonador 10.2.1 팻 시스템 구현
/**-------------------------------------------------------------------------------
@class SPetStateMachine
@brief finite state machine for pet
@author sonaodor
--------------------------------------------------------------------------------*/
class SPetStateMachine : public SObjectStateMachine
{
public:
SPetStateMachine() : SObjectStateMachine() {}
virtual ~SPetStateMachine() {}
virtual void OnInput( class SGameInput* input ) {} ///< preprocess about game input
virtual void OnNetInput( struct SGameMessage* msg ); ///< preprocess about network input
protected:
virtual void SendServerReq( SObjectState::ID state, const SStateInfo& infoState ) {}
SObjectState::ID m_StateID; ///< current state's id
SStateInfo m_StateInfo; ///< current state's information
};
/**-------------------------------------------------------------------------------
@class SLocalPetStateMachine
@brief finite state machine for local pet
@author sonaodor
--------------------------------------------------------------------------------*/
class SLocalPetStateMachine : public SPetStateMachine
{
public:
SLocalPetStateMachine();
virtual ~SLocalPetStateMachine() {}
virtual void OnInput( class SGameInput* input ); ///< preprocess about game input
virtual void OnNetInput( struct SGameMessage* msg ); ///< preprocess about network input
virtual void Process( DWORD dwTime );
protected:
virtual void SendServerReq( SObjectState::ID state, const SStateInfo& infoState );
SObjectState* CreateIdleState(); ///< idle state factory method
SObjectState* CreateMoveState(); ///< move state factory method
SObjectState* CreateChaseState(); ///< chase state factory method
SObjectState* CreateTakeItemState(); ///< take item state factory method
DWORD m_dwMoveUpdateTime;
};
/**-------------------------------------------------------------------------------
@class SOtherPetStateMachine
@brief finite state machine for not local pet
@author sonaodor
--------------------------------------------------------------------------------*/
class SOtherPetStateMachine : public SPetStateMachine
{
public:
SOtherPetStateMachine() : SPetStateMachine() {}
virtual ~SOtherPetStateMachine() {}
virtual void OnNetInput( struct SGameMessage* msg ); ///< preprocess about network input
protected:
SObjectState* CreateIdleState(); ///< idle state factor method
SObjectState* CreateMoveState(); ///< move state factor method
};