diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2011-11-28 11:21:22 +0100 |
---|---|---|
committer | Dominique Martinet <asmadeus@codewreck.org> | 2011-11-28 11:21:22 +0100 |
commit | e49f4b2329ee5acd59e681c1a67549685cf78054 (patch) | |
tree | ddf9a5e0ea0e1f17348577801b8eee2250e5821e /Cell.h | |
parent | 489547e7cd9192af86eb3edd673e0e6d395f906b (diff) |
reverted to old cell type
Diffstat (limited to 'Cell.h')
-rw-r--r-- | Cell.h | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -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.
};
|