From 245a34f1fad0e4fe2fb6401dc1d5352e4914b48a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Mon, 21 Sep 2020 21:37:33 +0200 Subject: Correct code is nice --- labb3/tiles/TileList.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'labb3/tiles/TileList.h') diff --git a/labb3/tiles/TileList.h b/labb3/tiles/TileList.h index 865823f..10cfdfb 100644 --- a/labb3/tiles/TileList.h +++ b/labb3/tiles/TileList.h @@ -16,7 +16,7 @@ public: ~TileList(); // deallocate the tile list void addTile(Tile tile); // add a tile to the tile list, possibly reallocating void drawAll(QGraphicsScene *scene) const; // draw all tiles to `scene` - int indexOfTopTile(int x, int y) const; + int indexOfTopTile(int x, int y) const; // return index of top tile at (x, y) void lower(int x, int y); // move the top tile at (x, y) to the bottom void raise(int x, int y); // move the bottom tile at (x, y) to the top void remove(int x, int y); // remove the top tile at (x, y) @@ -24,14 +24,10 @@ public: private: static const int INITIAL_SIZE = 10; // the initial size - static const int INCREASE_SIZE = 10; // how much the size is increased when - // it's needed int cur_size = 0; // current size of array int amount_tiles; // number of active tiles in array Tile *tiles; // the array - int indexOfBottomTile(int x, int y) const; - /* * shiftRight and shiftLeft move a group of tiles either right or left * in the internal array. -- cgit v1.2.1