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.h"
|
|
|
|
#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
|
|
|
|
{
|
|
|
|
class GameState : public GameClientState
|
|
|
|
{
|
2013-12-10 11:26:18 +01:00
|
|
|
enum gameStateState
|
|
|
|
{
|
|
|
|
gameStateState_loading,
|
|
|
|
gameStateState_playing,
|
|
|
|
gameStateState_end,
|
|
|
|
};
|
2013-12-09 09:23:39 +01:00
|
|
|
private:
|
2014-01-13 12:11:45 +01:00
|
|
|
|
|
|
|
bool key_forward;
|
|
|
|
bool key_backward;
|
|
|
|
bool key_strafeRight;
|
|
|
|
bool key_strafeLeft;
|
2014-01-27 13:56:31 +01:00
|
|
|
bool key_Shoot;
|
2014-01-30 09:07:56 +01:00
|
|
|
bool key_Jump;
|
2014-02-10 16:30:47 +01:00
|
|
|
Camera_FPS camera;
|
|
|
|
//Camera* camera;
|
2014-01-13 12:11:45 +01:00
|
|
|
|
2014-01-31 16:33:16 +01:00
|
|
|
int myId;
|
2014-02-10 16:30:47 +01:00
|
|
|
//float pitch;
|
2013-12-09 09:23:39 +01:00
|
|
|
struct myData;
|
|
|
|
myData* privData;
|
2014-02-10 14:00:14 +01:00
|
|
|
Utility::DynamicMemory::DynamicArray<Utility::DynamicMemory::SmartPointer<C_StaticObj>> staticObjects;
|
2014-02-10 14:41:43 +01:00
|
|
|
Utility::DynamicMemory::DynamicArray<Utility::DynamicMemory::SmartPointer<C_Object>> dynamicObjects;
|
|
|
|
//Utility::DynamicMemory::DynamicArray<Utility::DynamicMemory::SmartPointer<C_Player>> playObjects;
|
2013-12-06 10:38:43 +01:00
|
|
|
public:
|
|
|
|
GameState(void);
|
|
|
|
~GameState(void);
|
2013-12-16 09:45:12 +01:00
|
|
|
bool Init(Oyster::Network::NetworkClient* nwClient);
|
2013-12-13 12:02:49 +01:00
|
|
|
GameClientState::ClientState Update(float deltaTime, InputClass* KeyInput) override;
|
2014-02-10 16:28:25 +01:00
|
|
|
bool LoadModels(std::string mapFile);
|
|
|
|
bool LoadModels();
|
2013-12-13 12:02:49 +01:00
|
|
|
bool InitCamera(Oyster::Math::Float3 startPos) ;
|
2014-02-05 15:16:31 +01:00
|
|
|
void InitiatePlayer(int id, std::wstring modelName, Oyster::Math::Float4x4 world);
|
2013-12-10 11:26:18 +01:00
|
|
|
gameStateState LoadGame();
|
2014-01-23 08:24:35 +01:00
|
|
|
void readKeyInput(InputClass* KeyInput);
|
2013-12-13 12:02:49 +01:00
|
|
|
bool Render()override;
|
|
|
|
bool Release()override;
|
|
|
|
|
|
|
|
void Protocol(ProtocolStruct* pos)override;
|
2013-12-16 11:08:10 +01:00
|
|
|
void Protocol(PlayerPos* pos);
|
|
|
|
void Protocol(ObjPos* pos);
|
2013-12-18 12:18:01 +01:00
|
|
|
void Protocol( NewObj* pos );
|
2013-12-18 15:28:47 +01:00
|
|
|
void Protocol(RemoveObj* obj);
|
2013-12-13 12:02:49 +01:00
|
|
|
//void Protocol(LightPos pos);
|
2013-12-06 10:38:43 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2013-12-10 11:26:18 +01:00
|
|
|
#endif
|