mirror of
https://github.com/ApfelTeeSaft/PlanetFleet.git
synced 2026-08-26 19:33:38 +00:00
35 lines
758 B
C++
35 lines
758 B
C++
#ifndef GAME_H
|
|
#define GAME_H
|
|
|
|
#include "fx.h"
|
|
|
|
#include <vector>
|
|
|
|
namespace battleship{
|
|
class Player;
|
|
class Projectile;
|
|
|
|
class Game{
|
|
public:
|
|
static Game* getSingleton();
|
|
void update();
|
|
void togglePause();
|
|
void removeFx(int);
|
|
inline void addFx(Fx f){fx.push_back(f);}
|
|
inline void addPlayer(Player *pl){players.push_back(pl);}
|
|
inline void addProjectile(Projectile *proj){projectiles.push_back(proj);}
|
|
inline std::vector<Player*>& getPlayers(){return players;}
|
|
inline Player* getPlayer(int id){return players[id];}
|
|
inline int getNumPlayers(){return players.size();}
|
|
private:
|
|
Game(){}
|
|
|
|
bool paused = false;
|
|
std::vector<Fx> fx;
|
|
std::vector<Player*> players;
|
|
std::vector<Projectile*> projectiles;
|
|
};
|
|
}
|
|
|
|
#endif
|