diff options
Diffstat (limited to 'src/snake.h')
-rw-r--r-- | src/snake.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/snake.h b/src/snake.h index 9377575..dfa58cc 100644 --- a/src/snake.h +++ b/src/snake.h @@ -7,30 +7,39 @@ class QWidget; class QPaintEvent; -class RealSnake; +class Snake; struct Cell; +struct Ball; +struct Paddle; -class Snake +class GameCore { private: QWidget *_widget; - const Cell **_field; int _width, _height; - QList<RealSnake*> _snakes; + QList<Snake*> _snakes; + QList<Ball*> _balls; + QList<Paddle*> _paddles; int _deaths; qint64 _lastMeal; + const Cell **_field; public: - Snake(QWidget *widget); + const Cell *field(int x, int y) const { + return _field[x + _width * y]; + } + void setField(int x, int y, const Cell *val); + + GameCore(QWidget *widget); - virtual ~Snake(); + virtual ~GameCore(); void paint(QPaintEvent *event); void addFood(); - void scanDir(RealSnake *snake, int x, int y, const Cell* &what, int &dist); + void scanDir(Snake *snake, int x, int y, const Cell* &what, int &dist); void addSnake(); |