summaryrefslogtreecommitdiff
path: root/include/game_state.h
diff options
context:
space:
mode:
authorJustin Worthe <justin.worthe@gmail.com>2015-08-12 23:18:56 +0200
committerJustin Worthe <justin.worthe@gmail.com>2015-08-12 23:18:56 +0200
commit1da1c8d213ce710a9cafdd560d0d3d3c7fb74d70 (patch)
tree3ec371e909af1bda730b6325a40fbb74ac844806 /include/game_state.h
parent1049b6acb37c244ef7470b2e7fe4145a616d3df3 (diff)
Changing how gamestate is interpreted into network
Diffstat (limited to 'include/game_state.h')
-rw-r--r--include/game_state.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/game_state.h b/include/game_state.h
index 482dd7d..880557e 100644
--- a/include/game_state.h
+++ b/include/game_state.h
@@ -8,6 +8,7 @@
#include <vector>
#include <string>
#include <istream>
+#include <memory>
class GameState
{
@@ -19,7 +20,9 @@ public:
const std::vector<EnemyBullet>& bullets() const { return _bullets; }
const std::vector<PlayerMissile>& missiles() const { return _missiles; }
const std::vector<Shield>& shields() const { return _shields; }
- const std::vector<Spaceship>& spaceships() const { return _spaceships; }
+
+ const std::unique_ptr<Spaceship>& playerSpaceship() const { return _playerSpaceship; }
+ const std::unique_ptr<Spaceship>& enemySpaceship() const { return _enemySpaceship; }
std::vector<bool> toBitArray() const;
@@ -28,7 +31,8 @@ private:
std::vector<EnemyBullet> _bullets;
std::vector<PlayerMissile> _missiles;
std::vector<Shield> _shields;
- std::vector<Spaceship> _spaceships;
+ std::unique_ptr<Spaceship> _playerSpaceship;
+ std::unique_ptr<Spaceship> _enemySpaceship;
int addEntity(int x, int y, char type);
};