81 lines
1.5 KiB
C++
81 lines
1.5 KiB
C++
//
|
|
// Created by Louis Gallet on 15/01/2025.
|
|
//
|
|
|
|
#ifndef R234_H
|
|
#define R234_H
|
|
#include "Compteur.h"
|
|
|
|
|
|
class R234 {
|
|
private:
|
|
int direction;
|
|
int strength;
|
|
int speed;
|
|
int range;
|
|
|
|
public:
|
|
R234(int direction, int strength, int speed, int range) {
|
|
initialiser(direction, strength, speed, range);
|
|
Compteur::ajouterConstructeur();
|
|
}
|
|
|
|
R234(const R234 &r234) {
|
|
initialiser(r234.direction, r234.strength, r234.speed, r234.range);
|
|
Compteur::ajouterConstructeurCopie();
|
|
}
|
|
|
|
~R234() {
|
|
Compteur::ajouterDestructeur();
|
|
}
|
|
void initialiser(int direction, int strength, int speed, int range);
|
|
int doAttack(int defenceEnemy) const;
|
|
int doProtect(int attackEnemy) const;
|
|
void doMove(int& x, int& y) const;
|
|
void doRotateLeft();
|
|
void doRotateRight();
|
|
|
|
int getDirection() const {
|
|
return direction;
|
|
}
|
|
|
|
int getStrength() const {
|
|
return strength;
|
|
}
|
|
|
|
int getSpeed() const {
|
|
return speed;
|
|
}
|
|
|
|
int getRange() const {
|
|
return range;
|
|
}
|
|
|
|
void setDirection(int direction) {
|
|
if (direction < 0) {
|
|
this->direction = 0;
|
|
}
|
|
else if (direction > 3) {
|
|
this->direction = 3;
|
|
} else {
|
|
this->direction = direction;
|
|
}
|
|
}
|
|
void setStrength(int strength) {
|
|
this->strength = strength;
|
|
}
|
|
|
|
void setSpeed(int speed) {
|
|
this->speed = speed;
|
|
}
|
|
|
|
void setRange(int range) {
|
|
this->range = range;
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //R234_H
|