diff options
author | Simon Rettberg | 2019-05-25 17:48:41 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-05-25 17:48:41 +0200 |
commit | 5c92e0612ec7ae4ea329fa18792b94fcb5908cfd (patch) | |
tree | 5998ee5decde2afc0c20adefb011bc07c3bcee81 /src/snake.h | |
parent | Improve rendering even more (diff) | |
download | slxgreeter-5c92e0612ec7ae4ea329fa18792b94fcb5908cfd.tar.gz slxgreeter-5c92e0612ec7ae4ea329fa18792b94fcb5908cfd.tar.xz slxgreeter-5c92e0612ec7ae4ea329fa18792b94fcb5908cfd.zip |
Add news panel to the right of the login form
By pointing the new setting news-html-file to a file
containing QTextEdit-compatible html formatted text, you can
have a news panel show up on the login screen.
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(); |