2013-12-10 11:26:18 +01:00
|
|
|
#ifndef DANBIAS_CLIENT_GAMESTATE_H
|
|
|
|
#define DANBIAS_CLIENT_GAMESTATE_H
|
2013-12-06 10:38:43 +01:00
|
|
|
#include "GameClientState.h"
|
2013-12-10 11:26:18 +01:00
|
|
|
#include "OysterMath.h"
|
|
|
|
#include <string>
|
2014-02-10 16:30:47 +01:00
|
|
|
|
|
|
|
#include "Camera_FPS.h"
|
2014-02-10 14:00:14 +01:00
|
|
|
#include "LevelLoader/LevelLoader.h"
|
|
|
|
#include "C_obj/C_Player.h"
|
|
|
|
#include "C_obj/C_DynamicObj.h"
|
|
|
|
#include "C_obj/C_StaticObj.h"
|
|
|
|
#include "DynamicArray.h"
|
2013-12-06 10:38:43 +01:00
|
|
|
namespace DanBias
|
|
|
|
{
|
|
|
|
namespace Client
|
|
|
|
{
|
2014-02-12 09:02:44 +01:00
|
|
|
class GameState : public GameClientState
|
2013-12-10 11:26:18 +01:00
|
|
|
{
|
2014-02-12 09:02:44 +01:00
|
|
|
enum gameStateState
|
|
|
|
{
|
|
|
|
gameStateState_loading,
|
|
|
|
gameStateState_playing,
|
|
|
|
gameStateState_end,
|
|
|
|
};
|
|
|
|
private:
|
2014-02-12 16:31:15 +01:00
|
|
|
struct MyData;
|
|
|
|
::Utility::DynamicMemory::UniquePointer<MyData> privData;
|
2014-01-13 12:11:45 +01:00
|
|
|
|
2014-02-12 09:02:44 +01:00
|
|
|
bool key_forward;
|
|
|
|
bool key_backward;
|
|
|
|
bool key_strafeRight;
|
|
|
|
bool key_strafeLeft;
|
|
|
|
bool key_Shoot;
|
|
|
|
bool key_Jump;
|
|
|
|
Camera_FPS camera;
|
2014-01-13 12:11:45 +01:00
|
|
|
|
2014-02-12 09:02:44 +01:00
|
|
|
int myId;
|
2014-02-12 16:31:15 +01:00
|
|
|
|
2014-02-12 09:02:44 +01:00
|
|
|
Utility::DynamicMemory::DynamicArray<Utility::DynamicMemory::SmartPointer<C_StaticObj>> staticObjects;
|
|
|
|
Utility::DynamicMemory::DynamicArray<Utility::DynamicMemory::SmartPointer<C_Object>> dynamicObjects;
|
|
|
|
//Utility::DynamicMemory::DynamicArray<Utility::DynamicMemory::SmartPointer<C_Player>> playObjects;
|
|
|
|
public:
|
|
|
|
GameState(void);
|
|
|
|
~GameState(void);
|
|
|
|
bool Init(Oyster::Network::NetworkClient* nwClient);
|
|
|
|
GameClientState::ClientState Update(float deltaTime, InputClass* KeyInput) override;
|
|
|
|
bool LoadModels(std::string mapFile);
|
|
|
|
bool InitCamera(Oyster::Math::Float3 startPos) ;
|
|
|
|
void InitiatePlayer(int id, std::wstring modelName, Oyster::Math::Float4x4 world);
|
|
|
|
gameStateState LoadGame();
|
|
|
|
void readKeyInput(InputClass* KeyInput);
|
|
|
|
bool Render()override;
|
|
|
|
bool Release()override;
|
2014-02-12 16:31:15 +01:00
|
|
|
void ChangeState( ClientState next );
|
2013-12-13 12:02:49 +01:00
|
|
|
|
2014-02-12 10:43:06 +01:00
|
|
|
void DataRecieved( ::Oyster::Network::NetEvent<::Oyster::Network::NetworkClient*, ::Oyster::Network::NetworkClient::ClientEventArgs> e );
|
2014-02-12 09:02:44 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
2013-12-10 11:26:18 +01:00
|
|
|
#endif
|