2013-12-10 11:26:18 +01:00
|
|
|
#ifndef DANBIAS_CLIENT_GAMECLIENTSTATE_H
|
|
|
|
#define DANBIAS_CLIENT_GAMECLIENTSTATE_H
|
|
|
|
|
2013-12-09 09:23:39 +01:00
|
|
|
#define NOMINMAX
|
|
|
|
#include "L_inputClass.h"
|
2013-12-16 09:45:12 +01:00
|
|
|
#include "NetworkClient.h"
|
2013-12-09 09:23:39 +01:00
|
|
|
|
2014-02-11 14:47:57 +01:00
|
|
|
namespace DanBias { namespace Client
|
2013-12-06 10:38:43 +01:00
|
|
|
{
|
2014-02-12 10:43:06 +01:00
|
|
|
class GameClientState
|
2013-12-13 12:02:49 +01:00
|
|
|
{
|
2014-02-11 14:47:57 +01:00
|
|
|
public:
|
|
|
|
enum ClientState
|
|
|
|
{
|
|
|
|
ClientState_Login,
|
|
|
|
ClientState_Lobby,
|
|
|
|
ClientState_Lan,
|
2014-02-12 16:31:15 +01:00
|
|
|
ClientState_LobbyCreate,
|
2014-02-11 14:47:57 +01:00
|
|
|
ClientState_Game,
|
|
|
|
ClientState_Same,
|
2014-02-12 16:31:15 +01:00
|
|
|
ClientState_Quit
|
2014-02-11 14:47:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
public:
|
|
|
|
GameClientState(void);
|
|
|
|
virtual ~GameClientState(void);
|
|
|
|
virtual bool Init(Oyster::Network::NetworkClient* nwClient) = 0;
|
|
|
|
virtual ClientState Update(float deltaTime, InputClass* KeyInput) = 0;
|
|
|
|
virtual bool Render() = 0;
|
|
|
|
virtual bool Release() = 0;
|
2014-02-12 16:31:15 +01:00
|
|
|
virtual void ChangeState( ClientState next ) = 0;
|
2014-02-12 10:43:06 +01:00
|
|
|
|
|
|
|
virtual void DataRecieved( ::Oyster::Network::NetEvent<::Oyster::Network::NetworkClient*, ::Oyster::Network::NetworkClient::ClientEventArgs> e );
|
2014-02-11 14:47:57 +01:00
|
|
|
};
|
|
|
|
} }
|
2014-02-12 11:19:25 +01:00
|
|
|
|
|
|
|
namespace Utility { namespace DynamicMemory
|
|
|
|
{ // template specializationto allowuse of dynamicmemory tools
|
|
|
|
template<>
|
|
|
|
inline void SafeDeleteInstance( ::DanBias::Client::GameClientState *dynamicInstance )
|
|
|
|
{
|
|
|
|
if( dynamicInstance )
|
|
|
|
{
|
|
|
|
dynamicInstance->Release();
|
|
|
|
delete dynamicInstance;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} }
|
|
|
|
|
2013-12-10 11:26:18 +01:00
|
|
|
#endif
|