Danbias/Code/Game/GameLogic/Level.h

78 lines
2.7 KiB
C
Raw Normal View History

2013-11-28 08:33:29 +01:00
//////////////////////////////////////////////////
//Created by Erik and Linda of the GameLogic team
//////////////////////////////////////////////////
2013-11-19 11:07:14 +01:00
#ifndef LEVEL_H
#define LEVEL_H
2013-12-13 11:11:51 +01:00
#include <string>
2014-01-20 15:47:52 +01:00
#include "Player.h"
#include "StaticObject.h"
#include "DynamicObject.h"
#include "GameMode.h"
#include "Player.h"
2014-01-20 15:47:52 +01:00
#include "PhysicsAPI.h"
#include "TeamManager.h"
#include "DynamicArray.h"
2013-11-19 11:07:14 +01:00
namespace GameLogic
{
class Level
{
public:
Level(void);
~Level(void);
/********************************************************
* Initiates a level for players to play on
* @param levelPath: Path to a file that contains all information on the level
********************************************************/
void InitiateLevel(std::string levelPath);
2014-01-16 11:40:29 +01:00
void Level::InitiateLevel(float radius);
/********************************************************
* Creates a team in the level
* @param teamSize: The size of the team you want to create
********************************************************/
void CreateTeam(int teamSize);
/********************************************************
* Adds a player to a team
* @param player: The player you want to add to the team
* @param teamID: ArrayPos of the team you want to add the player to
********************************************************/
void AddPlayerToTeam(Player *player, int teamID);
/********************************************************
* Respawns a player on a random teammate
* @param player: The player you want to respawn
********************************************************/
void RespawnPlayer(Player *player);
/********************************************************
* Collision function for level, this is to be sent to physics through the subscribe function with the rigidbody
* Will be called when the physics detect a collision
* @param rigidBodyLevel: physics object of the level
* @param obj: physics object for the object that collided with the level
********************************************************/
static void LevelCollision(Oyster::Physics::ICustomBody *rigidBodyLevel, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss);
Object* GetObj( int ID ) const;
static void PhysicsOnMoveLevel(const Oyster::Physics::ICustomBody *object);
private:
2014-01-20 15:47:52 +01:00
TeamManager teamManager;
Utility::DynamicMemory::DynamicArray<Utility::DynamicMemory::SmartPointer<StaticObject>> staticObjects;
Utility::DynamicMemory::DynamicArray<Utility::DynamicMemory::SmartPointer<DynamicObject>> dynamicObjects;
GameMode gameMode;
Utility::DynamicMemory::SmartPointer<Oyster::Physics::ICustomBody> rigidBodyLevel;
2014-01-23 08:57:46 +01:00
StaticObject *levelObj;
2014-01-27 14:43:39 +01:00
DynamicObject *testBox;
2013-11-19 11:07:14 +01:00
};
}
#endif