Newer
Older
Grégoire Payen de La Garanderie
committed
#ifndef TABLE_H_INCLUDED
#define TABLE_H_INCLUDED
#include <QWidget>
#include "TableGraphics.h"
#include "XMLReader.h"
#include "sensors.h"
Victor Dubois
committed
//#include "bougie.h"
//#include "v1-archive/singleton.h"
Grégoire Payen de La Garanderie
committed
class MainWindow;
class Table : public QWidget//, public Singleton<Table>
Grégoire Payen de La Garanderie
committed
{
//friend class Singleton<Table>;
Grégoire Payen de La Garanderie
committed
private:
int dt;
std::vector<Objet*> objets;
std::vector<Robot*> robots;
b2World world;
b2Body* tableBody;
TableGraphics tableGraphics;
Grégoire Payen de La Garanderie
committed
void addCard(unsigned int n, int column);
MainWindow* mainWindow;
static Table* _instance;
Grégoire Payen de La Garanderie
committed
Grégoire Payen de La Garanderie
committed
static const int tableWidth = 3000;
static const int tableHeight = 2000;
Victor Dubois
committed
//Bougie p_bougies[20];
//Bougie p_balles[20];
Grégoire Payen de La Garanderie
committed
//static const int tableWidth = 2100;
//static const int tableHeight = 3000;
static Table* getMainInstance();
Table(MainWindow* mainWindow, QWidget* parent = 0, bool isBlue = true);
Grégoire Payen de La Garanderie
committed
virtual ~Table();
void update(int dt);
Grégoire Payen de La Garanderie
committed
void paintEvent(QPaintEvent* evt);
void keyPressEvent(QKeyEvent* evt, bool press);
void mousePressEvent(QMouseEvent* evt, bool press);
float getDistanceToObject(Position pos);
void removeClosestObject(Position pos);
Robot* getMainRobot();
std::vector<Objet*> findObjectsNear(Position pos, Distance searchRadius = 0., Objet::Type type = Objet::ANY);
Grégoire Payen de La Garanderie
committed
};
#endif