new state: NetLoadState
This commit is contained in:
parent
fe6742f9e2
commit
c1d63a1477
|
@ -0,0 +1,58 @@
|
|||
#include "NetLoadState.h"
|
||||
#include "NetworkClient.h"
|
||||
|
||||
using namespace ::DanBias::Client;
|
||||
using namespace ::Oyster;
|
||||
using namespace ::Oyster::Network;
|
||||
|
||||
struct NetLoadState::MyData
|
||||
{
|
||||
MyData() {}
|
||||
|
||||
GameClientState::ClientState nextState;
|
||||
NetworkClient *nwClient;
|
||||
};
|
||||
|
||||
NetLoadState::NetLoadState(void) {}
|
||||
|
||||
NetLoadState::~NetLoadState(void)
|
||||
{
|
||||
if( this->privData )
|
||||
this->Release();
|
||||
}
|
||||
|
||||
bool NetLoadState::Init( NetworkClient* nwClient )
|
||||
{
|
||||
this->privData = new MyData();
|
||||
|
||||
this->privData->nextState = GameClientState::ClientState_Same;
|
||||
this->privData->nwClient = nwClient;
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
GameClientState::ClientState NetLoadState::Update(float deltaTime, InputClass* KeyInput)
|
||||
{
|
||||
return this->privData->nextState;
|
||||
}
|
||||
|
||||
bool NetLoadState::Render()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NetLoadState::Release()
|
||||
{
|
||||
if( this->privData )
|
||||
{
|
||||
this->privData = NULL;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void NetLoadState::ChangeState( ClientState next )
|
||||
{
|
||||
this->privData->nextState = next;
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
#ifndef DANBIAS_CLIENT_NETLOADSTATE_H
|
||||
#define DANBIAS_CLIENT_NETLOADSTATE_H
|
||||
|
||||
#include "GameClientState.h"
|
||||
#include "NetworkClient.h"
|
||||
|
||||
namespace DanBias
|
||||
{
|
||||
namespace Client
|
||||
{
|
||||
class NetLoadState : public GameClientState
|
||||
{
|
||||
private:
|
||||
struct MyData;
|
||||
::Utility::DynamicMemory::UniquePointer<MyData> privData;
|
||||
public:
|
||||
NetLoadState( );
|
||||
virtual ~NetLoadState( );
|
||||
|
||||
bool Init( Oyster::Network::NetworkClient* nwClient );
|
||||
ClientState Update( float deltaTime, InputClass* KeyInput );
|
||||
|
||||
bool Render();
|
||||
bool Release();
|
||||
void ChangeState( ClientState next );
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif // ! DANBIAS_CLIENT_LOGINSTATE_H
|
Loading…
Reference in New Issue