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/Junk.h | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'labb4/Junk.h') diff --git a/labb4/Junk.h b/labb4/Junk.h index 30659ab..65201c4 100644 --- a/labb4/Junk.h +++ b/labb4/Junk.h @@ -16,18 +16,25 @@ public: ~Junk() {} /* - * Draws this junk onto the given QGraphicsScene. - */ + * Draws this junk onto the given QGraphicsScene. + */ void draw(QGraphicsScene* scene) const override; - void moveTowards(const Unit& u) override; + void moveTowards(const Unit& u) override {} - bool attacks(const Unit& u) const override; - - unsigned int getCollisionCount() const override; + /* + * Junk can't attack in any direction. + */ + bool attacks(const Unit&) const override { return false; } - bool alive() const override; + /* + * All junk is dead. + */ + bool alive() const override { return false; } + /* + * Polymorphic clone. + */ Junk *clone() const override; }; -- cgit v1.2.1