summaryrefslogtreecommitdiffstats
path: root/labb4/GameState.h
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2020-11-10 14:57:44 +0100
committerGustav Sörnäs <gustav@sornas.net>2020-11-10 14:57:44 +0100
commit00b84ef1485204e03395e7c90634bc7de16cd9fb (patch)
treeaf7c08bba9908d61d6076a93ee7a2c83773f201d /labb4/GameState.h
parent01862f6b40c0f8fbc0123f1ac5140a406c268251 (diff)
downloadtddd86-00b84ef1485204e03395e7c90634bc7de16cd9fb.tar.gz
comments and cleanup
Diffstat (limited to 'labb4/GameState.h')
-rw-r--r--labb4/GameState.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/labb4/GameState.h b/labb4/GameState.h
index ac749bb..dfd7ac5 100644
--- a/labb4/GameState.h
+++ b/labb4/GameState.h
@@ -24,25 +24,28 @@ public:
GameState(const GameState &other);
~GameState();
+ /*
+ * Copy assignment.
+ */
GameState &operator=(const GameState &other);
/*
- * Clear and redraw entire playing field
+ * Clear and redraw entire playing field.
*/
- void draw(QGraphicsScene* scene) const; // Clear and redraw entire playing field
+ void draw(QGraphicsScene* scene) const;
/*
- * Teleport hero to random location
+ * Teleport hero to random location.
*/
void teleportHero();
/*
- * Move robots one step towards hero
+ * Move robots one step towards hero.
*/
void moveRobots();
/* Count colliding robots.
- * Also converts robots to junk while checking collisions
+ * Also converts robots to junk while checking collisions.
*/
int countCollisions ();
@@ -59,21 +62,21 @@ public:
/*
* Can unit safely reside here?
*/
- bool isSafe (const Unit& unit) const; // Can unit safely reside here?
+ bool isSafe (const Unit& unit) const;
/*
- * Move hero towards dir
+ * Move hero towards dir.
*/
void moveHeroTowards (const Unit& dir);
/*
- * Return hero
+ * Return hero.
*/
Hero getHero () const;
private:
- std::vector<Robot *> robots; // the robots and the junk combined
- Hero hero; // the hero
+ std::vector<Robot *> robots; // the robots and the junk combined
+ Hero hero; // the hero
// private helpers
bool isEmpty(const Unit& unit) const;