diff options
Diffstat (limited to 'backend/Enemy.cpp')
-rw-r--r-- | backend/Enemy.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/backend/Enemy.cpp b/backend/Enemy.cpp index c4bfff2..a2bab30 100644 --- a/backend/Enemy.cpp +++ b/backend/Enemy.cpp @@ -12,11 +12,13 @@ const String & Enemy::get_description() const { return this->description; } void Enemy::set_attack(float attack_chance) { this->attack_chance = attack_chance; } float Enemy::get_attack() const { return this->attack_chance; } -void Enemy::set_damage_min(int damage_min) { this->damage_min = damage_min; } -int Enemy::get_damage_min() const { return this->damage_min; } - -void Enemy::set_damage_max(int damage_max) { this->damage_max = damage_max; } -int Enemy::get_damage_max() const { return this->damage_max; } +void Enemy::set_damage(const Range<int> & range) { + this->damage_min = range.min; + this->damage_max = range.max; +} +Range<int> Enemy::get_damage() const { + return { this->damage_min, this->damage_max }; +} void Enemy::set_health(unsigned health_points) { this->health_points = health_points; } unsigned Enemy::get_health() const { return this->health_points; } |