use vector for choose direction
This commit is contained in:
18
app.h
18
app.h
@@ -5,12 +5,19 @@
|
||||
#include "interface/iStompObserver.h"
|
||||
#include "stomp.h"
|
||||
#include <QVector2D>
|
||||
#include <cmath>
|
||||
|
||||
#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);
|
||||
@@ -20,14 +27,12 @@ private:
|
||||
void disconnectConfirmation();
|
||||
void disconnectIndication();
|
||||
|
||||
private:
|
||||
protected:
|
||||
Stomp* st_;
|
||||
|
||||
typedef struct {
|
||||
int x;
|
||||
int y;
|
||||
Vector2D coordinate;
|
||||
int pts;
|
||||
QVector2D relativePts;
|
||||
} Gem;
|
||||
|
||||
typedef struct {
|
||||
@@ -37,11 +42,10 @@ private:
|
||||
} Vehicle;
|
||||
|
||||
QVector<Gem> gems_;
|
||||
Vehicle myVehicle_;
|
||||
Vector2D myVehicle_;
|
||||
void addGem(int x, int y, int pts);
|
||||
void printGem();
|
||||
void fillField(QString body);
|
||||
QVector2D computeRelativePts(Gem g);
|
||||
Vector2D computeRelativePts(Gem g);
|
||||
void computeMove();
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user