summaryrefslogtreecommitdiffstats
path: root/src/snake.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/snake.h')
-rw-r--r--src/snake.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/snake.h b/src/snake.h
index 502c53f..9377575 100644
--- a/src/snake.h
+++ b/src/snake.h
@@ -7,16 +7,19 @@
class QWidget;
class QPaintEvent;
+class RealSnake;
+
+struct Cell;
+
class Snake
{
private:
QWidget *_widget;
- int *_field;
+ const Cell **_field;
int _width, _height;
- int _x, _y;
- int _direction;
- int _snakeLen;
- QList<QPoint> _snake;
+ QList<RealSnake*> _snakes;
+ int _deaths;
+ qint64 _lastMeal;
public:
Snake(QWidget *widget);
@@ -27,7 +30,11 @@ public:
void addFood();
- void scanDir(int x, int y, int &what, int &dist);
+ void scanDir(RealSnake *snake, int x, int y, const Cell* &what, int &dist);
+
+ void addSnake();
+
+ void initField();
};
#endif