From af5318af9e819fad237b5f7f5c0dc32ea6edecdc Mon Sep 17 00:00:00 2001 From: Christos Houtouridis Date: Tue, 6 Nov 2018 10:33:15 +0200 Subject: [PATCH] A Snake class rework --- src/SnakePkg/Snake.java | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/SnakePkg/Snake.java b/src/SnakePkg/Snake.java index c7f1ecf..3f8acfd 100755 --- a/src/SnakePkg/Snake.java +++ b/src/SnakePkg/Snake.java @@ -1,24 +1,37 @@ package SnakePkg; /** - * A class to represent a Snake in the Board + * @class Snake + * @brief Represent a Snake in the Board. + * + * Snakes are part of the elements we place on the board and they add + * difficulty to the game. + * * @author Christos Choutouridis 8997 + * @email cchoutou@ece.auth.gr */ public class Snake { /** @name Constructors */ /** @{ */ - /** Default ctor */ + /** Default doing nothing constructor */ Snake () { snakeId = headId = tailId = 0; } - /** Main Constructor */ + + /** + * @brief Main constructor + * This creates a snake on the board. + * @param snakeId The id of snake to create + * @param headId The tile of snake's head + * @param tailId The tile of snake's tail + */ Snake (int snakeId, int headId, int tailId) { this.snakeId = snakeId; this.headId = headId; this.tailId = tailId; } /** Copy constructor - * @note We don't use clone as long as we don't inherit Cloneable iface + * @param s The snake we want to copy */ Snake (Snake s) { snakeId = s.getSnakeId (); @@ -39,8 +52,8 @@ public class Snake { /** @name Data members (private) */ /** @{ */ - private int snakeId; //!< Snake's ID - private int headId; //!< Snake's head tile location - private int tailId; //!< Snake's tail tile location + private int snakeId; /**< Snake's ID */ + private int headId; /**< Snake's head tile location */ + private int tailId; /**< Snake's tail tile location */ /** @} */ }