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:
@@ -0,0 +1,25 @@
|
||||
#include "game.h"
|
||||
#include "player.h"
|
||||
#include "projectile.h"
|
||||
|
||||
namespace battleship{
|
||||
static Game *game = nullptr;
|
||||
|
||||
Game* Game::getSingleton(){
|
||||
if(!game)
|
||||
game = new Game();
|
||||
|
||||
return game;
|
||||
}
|
||||
|
||||
void Game::update(){
|
||||
for(Player *p : players)
|
||||
p->update();
|
||||
|
||||
for(Projectile *proj : projectiles)
|
||||
proj->update();
|
||||
}
|
||||
|
||||
void Game::togglePause(){
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user