-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtank.h
74 lines (63 loc) · 1.79 KB
/
tank.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef TANK_H
#define TANK_H
#define NBOBUS2 10
#define NBOBUS3 5
#define T_OBUS 0
#define T_MISSILE 1
#define T_NUKE 2
#include <QPixmap>
#include <QPoint>
#include <QPointF>
#include <random>
#include <vector>
#include <projectile.h>
#include <obus.h>
#include <missile.h>
#include <nuke.h>
class Tank
{
private:
int horizon; //Angle du canon horizontalement de 0 à 360°
int angleDeTir;
int capacite; //capacité de déplacement restant au tank initialisé à L/10
int nbObus2 = NBOBUS2;
int nbObus3 = NBOBUS3;
bool alive;
QPoint add;
int orientation; // orientation, 0 haut, 1 gauche, 2 bas, 3 droite
QPixmap * textureHaut;
QPixmap * textureBas;
QPixmap * textureGauche;
QPixmap * textureDroite;
public:
Tank();
Projectile *useObus(QPoint posTank, int dir, int puis);
Projectile *useMissile(QPoint posTank, int dir, int puis);
Projectile *useNuke(QPoint posTank, int dir, int puis);
int getNbObus2() const;
int getNbObus3() const;
int getOrientation() const;
void setOrientation(int value);
bool enleverCapacite();
bool enleverCapacite(int cx);
void makeZeroCapacite();
bool capaciteRestante();
void setCapacite(int newCap);
QPixmap getTexture();
void setTextureGauche(QPixmap* newTexture);
void setTextureDroite(QPixmap* newTexture);
void setTextureHaut(QPixmap* newTexture);
void setTextureBas(QPixmap* newTexture);
QPoint getAdd() const;
void setAdd(const QPoint &value);
bool isAlive();
void setDead();
void moveBy(int dx, int dy);
int getHorizon() const;
void setHorizon(int value);
int getAngleDeTir() const;
void setAngleDeTir(int value);
~Tank();
Projectile *useProjectile(QPoint posTank, int dir, int puis, int type);
};
#endif // TANK_H