mirror of
https://github.com/devZoGok/PlanetFleet.git
synced 2026-08-26 19:43:29 +00:00
implemented central Game class
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
#pragma once
|
||||
#ifndef PLAYER_H
|
||||
#define PLAYER_H
|
||||
|
||||
@@ -8,6 +7,9 @@
|
||||
#include "unit.h"
|
||||
|
||||
namespace battleship{
|
||||
class ResourceDeposit;
|
||||
class Projectile;
|
||||
|
||||
class Player {
|
||||
public:
|
||||
Player(int, int, int, vb01::Vector3 = vb01::Vector3::VEC_ZERO);
|
||||
@@ -16,13 +18,14 @@ namespace battleship{
|
||||
void issueOrder(Order::TYPE, std::vector<Order::Target>, bool);
|
||||
void deselectUnit(int);
|
||||
void deselectUnits();
|
||||
bool isThisPlayersUnit(Unit*);
|
||||
bool isThisPlayersUnit(GameObject*);
|
||||
const inline std::vector<Unit*>& getSelectedUnits(){return selectedUnits;}
|
||||
inline Unit* getSelectedUnit(int i){return selectedUnits[i];}
|
||||
inline int getNumSelectedUnits(){return selectedUnits.size();}
|
||||
inline void selectUnit(Unit *u){selectedUnits.push_back(u);}
|
||||
inline void selectUnits(std::vector<Unit*> units){selectedUnits = units;}
|
||||
inline void addUnit(Unit *u){units.push_back(u);}
|
||||
inline void addResourceDeposit(ResourceDeposit *rd){resourceDeposits.push_back(rd);}
|
||||
inline Unit* getUnit(int i){return units[i];}
|
||||
inline std::vector<Unit*>& getUnits(){return units;}
|
||||
inline void setId(int i){id=i;}
|
||||
@@ -43,6 +46,8 @@ namespace battleship{
|
||||
private:
|
||||
int refineds = 0, wealth = 0, research = 0, faction, difficulty,side,id;
|
||||
std::vector<Unit*> units, selectedUnits;
|
||||
std::vector<Projectile*> projectiles;
|
||||
std::vector<ResourceDeposit*> resourceDeposits;
|
||||
vb01::Vector3 spawnPoint;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user