-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcarai.h
39 lines (34 loc) · 906 Bytes
/
carai.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef CARAI_H
#define CARAI_H
#include "car.h"
#include "mymath.h"
#include <QTimer>
#include <QtCore>
#include "graphicscene.h"
const float MAX_VISIBILITY_LENGTH = 6 * CAR_LENGTH;
const float MAX_VISIBILITY_WIDTH = 1.2 * CAR_WIDTH;
const float REACTION_COEFFICIENT = 0.025 * MAX_SPEED;
const float SUCCESS_EPS = 20;
const float STOP_POINT = 2 * CAR_LENGTH;
class CarAI : public QObject
{
Q_OBJECT
private:
GraphicScene* graphicsScene;
Car* car;
const QVector<RoadPoint>* path;
int currPoint;
QTimer* timer;
const QVector<CarAI>* carAIs;
bool processDone;
public:
CarAI(const CarAI& other);
CarAI(CarAI&& other) noexcept;
CarAI(const QVector<RoadPoint>* path, const QVector<CarAI>* carAIs, GraphicScene* graphicsScene);
~CarAI() override;
void Update();
void ForceStop();
bool isDone() const;
Car* GetCar() const;
};
#endif // CARAI_H