summaryrefslogtreecommitdiffstats
path: root/labb3/tiles/TileList.h
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2020-09-21 21:37:33 +0200
committerGustav Sörnäs <gustav@sornas.net>2020-09-21 21:38:27 +0200
commit245a34f1fad0e4fe2fb6401dc1d5352e4914b48a (patch)
tree566511b6f032c25cc60dfb580147d3a929021bb9 /labb3/tiles/TileList.h
parent56dc03a2791f6d2bec86285fed1a12907d7ff661 (diff)
downloadtddd86-245a34f1fad0e4fe2fb6401dc1d5352e4914b48a.tar.gz
Correct code is nice
Diffstat (limited to 'labb3/tiles/TileList.h')
-rw-r--r--labb3/tiles/TileList.h6
1 files changed, 1 insertions, 5 deletions
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.