#ifndef _CELL_H #define _CELL_H #include "types.h" // Forward declaration to avoid circular include class Player; // Nothing more to define here except if you want intelligence to be in the cells. struct Coordinates { int x; int y; Coordinates(int _x = 0, int _y = 0): x(_x), y(_y) {} }; typedef enum { EMPTY_CELL, BOOM, PLAYER, PLAYER_WALL, PLAYER_JUST_MOVED } CellState; class Cell { public: Cell(void); Cell(CellState cs); virtual ~Cell(void); public: /** * Changes the state of this cell **/ void setState(CellState cs); /** * Returns the cell's state. **/ CellState getState(); /** * If a player is or was on the cell, return it **/ Player* getPlayer(); /** * Define that a player is currently on this cell. **/ 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. }; #endif