From 00b84ef1485204e03395e7c90634bc7de16cd9fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Tue, 10 Nov 2020 14:57:44 +0100 Subject: comments and cleanup --- labb4/GameState.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'labb4/GameState.h') 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 robots; // the robots and the junk combined - Hero hero; // the hero + std::vector robots; // the robots and the junk combined + Hero hero; // the hero // private helpers bool isEmpty(const Unit& unit) const; -- cgit v1.2.1