Danbias/Code/Game/GameClient/GameClientState/GameClientState.h

52 lines
1.2 KiB
C
Raw Normal View History

#ifndef DANBIAS_CLIENT_GAMECLIENTSTATE_H
#define DANBIAS_CLIENT_GAMECLIENTSTATE_H
#define NOMINMAX
#include "L_inputClass.h"
#include "NetworkClient.h"
2014-02-11 14:47:57 +01:00
namespace DanBias { namespace Client
{
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
{
2014-02-14 14:31:01 +01:00
ClientState_Main,
2014-02-11 14:47:57 +01:00
ClientState_Lan,
2014-02-13 13:30:14 +01:00
ClientState_Lobby,
2014-02-12 16:31:15 +01:00
ClientState_LobbyCreate,
2014-02-13 13:30:14 +01:00
ClientState_LobbyReady,
2014-02-14 14:31:01 +01:00
ClientState_NetLoad,
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
};
} }
namespace Utility { namespace DynamicMemory
{ // template specializationto allowuse of dynamicmemory tools
template<>
inline void SafeDeleteInstance( ::DanBias::Client::GameClientState *dynamicInstance )
{
if( dynamicInstance )
{
dynamicInstance->Release();
delete dynamicInstance;
}
}
} }
#endif