2014-01-13 12:44:33 +01:00
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
// Created by [Erik Persson] [2013]
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
2014-01-10 12:33:04 +01:00
|
|
|
#ifndef GAME_H
|
|
|
|
#define GAME_H
|
|
|
|
|
2014-01-13 12:44:33 +01:00
|
|
|
#include "GameLogicDef.h"
|
2014-01-10 12:33:04 +01:00
|
|
|
#include "GameLogicStates.h"
|
2014-01-15 11:03:25 +01:00
|
|
|
#include <OysterMath.h>
|
2014-01-13 12:44:33 +01:00
|
|
|
|
2014-01-10 12:33:04 +01:00
|
|
|
namespace GameLogic
|
|
|
|
{
|
2014-01-14 10:28:12 +01:00
|
|
|
class Player;
|
2014-01-15 11:03:25 +01:00
|
|
|
class DANBIAS_GAMELOGIC_DLL Game
|
2014-01-10 12:33:04 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
2014-01-15 11:03:25 +01:00
|
|
|
struct DANBIAS_GAMELOGIC_DLL PlayerData
|
2014-01-10 12:33:04 +01:00
|
|
|
{
|
2014-01-14 10:28:12 +01:00
|
|
|
private:
|
|
|
|
friend class Game;
|
|
|
|
Player *player;
|
|
|
|
PlayerData();
|
|
|
|
PlayerData(int playerID,int teamID);
|
2014-01-15 11:03:25 +01:00
|
|
|
~PlayerData();
|
2014-01-10 12:33:04 +01:00
|
|
|
|
2014-01-15 11:03:25 +01:00
|
|
|
public:
|
2014-01-14 10:28:12 +01:00
|
|
|
/********************************************************
|
|
|
|
* Moves the chosen player based on input
|
|
|
|
* @param playerID: ID of the player you want to recieve the message
|
|
|
|
* @param movement: enum value on what kind of action is to be taken
|
|
|
|
********************************************************/
|
2014-01-15 11:03:25 +01:00
|
|
|
void Move(const PLAYER_MOVEMENT &movement);
|
2014-01-14 10:28:12 +01:00
|
|
|
|
2014-01-15 11:03:25 +01:00
|
|
|
/********************************************************
|
|
|
|
* Uses the chosen players weapon based on input
|
|
|
|
* @param playerID: ID of the player you want to recieve the message
|
|
|
|
* @param Usage: enum value on what kind of action is to be taken
|
|
|
|
********************************************************/
|
|
|
|
void UseWeapon(int playerID, const WEAPON_FIRE &Usage);
|
2014-01-14 10:28:12 +01:00
|
|
|
|
2014-01-15 11:03:25 +01:00
|
|
|
/********************************************************
|
|
|
|
* Gets players position
|
|
|
|
* @param playerID: ID of the player whos position you want
|
|
|
|
********************************************************/
|
|
|
|
Oyster::Math::Float3 GetPosition();
|
|
|
|
|
|
|
|
/********************************************************
|
|
|
|
* Gets players current orientation
|
|
|
|
* @param playerID: ID of the player whos position you want
|
|
|
|
********************************************************/
|
|
|
|
Oyster::Math::Float4x4 GetOrientation();
|
|
|
|
|
|
|
|
/********************************************************
|
|
|
|
* Check player state
|
|
|
|
* @return The current player state
|
|
|
|
********************************************************/
|
|
|
|
PLAYER_STATE GetState() const;
|
|
|
|
|
|
|
|
/***/
|
|
|
|
int GetID() const;
|
|
|
|
|
|
|
|
/***/
|
|
|
|
int GetTeamID() const;
|
2014-01-10 12:33:04 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
public:
|
|
|
|
Game(void);
|
|
|
|
~Game(void);
|
|
|
|
|
|
|
|
/********************************************************
|
|
|
|
* Gets the position of all players currently in the game
|
|
|
|
********************************************************/
|
2014-01-15 11:03:25 +01:00
|
|
|
void GetAllPlayerPositions() const;
|
2014-01-10 12:33:04 +01:00
|
|
|
|
|
|
|
/********************************************************
|
|
|
|
* Creates a player and returns PlayerData containing ID of the player
|
|
|
|
********************************************************/
|
2014-01-15 11:03:25 +01:00
|
|
|
PlayerData* CreatePlayer();
|
2014-01-10 12:33:04 +01:00
|
|
|
|
|
|
|
/********************************************************
|
|
|
|
* Creates a team
|
|
|
|
********************************************************/
|
|
|
|
void CreateTeam();
|
|
|
|
|
|
|
|
/********************************************************
|
|
|
|
* Runs a update of the gamelogic and physics
|
|
|
|
********************************************************/
|
|
|
|
void NewFrame();
|
|
|
|
|
|
|
|
private:
|
|
|
|
struct PrivateData;
|
|
|
|
PrivateData *myData;
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|