Skip to content
table.h 1.21 KiB
Newer Older
#ifndef TABLE_H_INCLUDED
#define TABLE_H_INCLUDED

#include <QWidget>
#include <Box2D.h>
#include "TableGraphics.h"
#include "XMLReader.h"
hilnius's avatar
hilnius committed
#include "v1-archive/singleton.h"
#include "position.h"
#include "robot.h"
Victor Dubois's avatar
Victor Dubois committed
#include "contactlistener.h"
class Table : public QWidget, public Singleton<Table>
    friend class Singleton<Table>;
Victor Dubois's avatar
Victor Dubois committed
    ContactListener contactListenerTable;
    static const int tableHeight = 2000;
	static b2AABB getWorldAABB();
	//static const int tableWidth = 2100;
	//static const int tableHeight = 3000;

    Table(QWidget* widget = NULL, bool isBlue = true);
	virtual ~Table();

	void update(int dt);
	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();