summaryrefslogblamecommitdiffstats
path: root/src/snake.h
blob: 937757510f5a1461563f77f3c590fe6684034de8 (plain) (tree)
1
2
3
4
5
6
7
8
9








                  



                



                         
                        
                        


                              









                                   




                                                                               


      
#ifndef _SNAKE_H_
#define _SNAKE_H_

#include <QList>
#include <QPoint>

class QWidget;
class QPaintEvent;

class RealSnake;

struct Cell;

class Snake
{
private:
	QWidget *_widget;
    const Cell **_field;
    int _width, _height;
    QList<RealSnake*> _snakes;
    int _deaths;
    qint64 _lastMeal;

public:
    Snake(QWidget *widget);

    virtual ~Snake();

    void paint(QPaintEvent *event);

    void addFood();

    void scanDir(RealSnake *snake, int x, int y, const Cell* &what, int &dist);

    void addSnake();

    void initField();
};

#endif