#ifndef APP_H #define APP_H #include #include "interface/iStompObserver.h" #include "stomp.h" #include #include #include "Vector2D.h" #define GRID_SIZE 32 class App : public QObject, public interface::iStompObserver { public: App(Stomp* st); ~App() = default; const double MAX_LENGHT = sqrt(GRID_SIZE*GRID_SIZE + GRID_SIZE*GRID_SIZE); // iStompObserver interface private: void connectConfirmation(bool success, QString version); void sendConfirmation(bool success); void subscribeConfirmation(bool success); void receiveIndication(int id, QString destination, QString body); void disconnectConfirmation(); void disconnectIndication(); protected: Stomp* st_; typedef struct { Vector2D coordinate; int relativeDistanceToMe; int relativeDistanceToOtherPlayer; int pts; } Gem; typedef struct { int x; int y; bool me; } Vehicle; QVector gems_; Vector2D myVehicle_; QVector otherVehicles_; void addGem(int x, int y, int pts); void fillField(QString body); Vector2D computeRelativePts(Gem g); void computeRelativeDistance(Gem* g); void computeMove(); }; #endif // APP_H