summaryrefslogtreecommitdiffstats
path: root/Cell.h
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2011-11-28 11:21:22 +0100
committerDominique Martinet <asmadeus@codewreck.org>2011-11-28 11:21:22 +0100
commite49f4b2329ee5acd59e681c1a67549685cf78054 (patch)
treeddf9a5e0ea0e1f17348577801b8eee2250e5821e /Cell.h
parent489547e7cd9192af86eb3edd673e0e6d395f906b (diff)
reverted to old cell type
Diffstat (limited to 'Cell.h')
-rw-r--r--Cell.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/Cell.h b/Cell.h
index 67ccc84..44c3bab 100644
--- a/Cell.h
+++ b/Cell.h
@@ -15,11 +15,14 @@ struct Coordinates
};
-typedef uint8 CellState;
-// empty if 0 so we can just do "if (cell)"
-// player id is CellState/2, it's a real player if it's odd, a wall if even.
-#define EMPTY_CELL 0
-#define BOOM 1
+typedef enum
+{
+ EMPTY_CELL,
+ BOOM,
+ PLAYER,
+ PLAYER_WALL,
+ PLAYER_JUST_MOVED
+} CellState;
class Cell
{
@@ -33,10 +36,12 @@ public:
void setState(CellState cs);
CellState getState();
- PlayerNumber getPlayer();
+ Player* getPlayer();
+ void setPlayer(Player* pPlayer);
private:
CellState m_currentState;
+ Player* m_pPlayer; // A pointer to the player currently or previously on this space. May be NULL.
};