Skip to content
Snippets Groups Projects
Commit 77c17106 authored by Lorenz Martin Diel's avatar Lorenz Martin Diel
Browse files

first commit

parent 762f668a
No related branches found
No related tags found
No related merge requests found
#ifndef UNIT_HPP
#define UNIT_HPP
#include <string>
#include <utility>
// Enumerationen für Bewegungstyp und Waffenart
enum class MovementType {
Foot,
Tracks,
Wheels,
Air,
Shipengine
};
enum class WeaponType {
Gun,
Rocket
};
// Deklaration der Unit-Klasse
class Unit {
public:
Unit(int x, int y);
// Konstruktor
Unit(std::string name, int health, int speed, int attack, std::pair<int,int> range, MovementType movement, WeaponType weapon);
// Getter-Methoden
std::string getName() const;
int getHealth() const;
int getSpeed() const;
int getAttack() const;
std::pair<int, int> getRange() const;
MovementType getMovementType() const;
WeaponType getWeaponType() const;
int getX() const;
int getY() const;
// Setter-Methoden
void setPosition(int newX, int newY);
void setHealth(int newHealth);
void setSpeed(int newSpeed);
private:
// Position
int x;
int y;
// Private Membervariablen der Einheit
std::string name;
int health;
int speed;
int attack;
std::pair<int, int> range; // Angriffsreichweite
MovementType movement;
WeaponType weapon;
int x; // Position auf der x-Achse
int y; // Position auf der y-Achse
};
#endif
#endif // UNIT_HPP
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment