aboutsummaryrefslogtreecommitdiff
path: root/backend/WeaponObject.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-01 21:33:27 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-01 21:33:27 +0100
commitaf76b9a0ae58dc8c87548053a5bc310ad6be25ce (patch)
treeb2aa5927ed19855c101120593b59a9c3224804ad /backend/WeaponObject.cpp
parentbdf6ac149ec260dab767663419731b302679f458 (diff)
more small tweaks
Diffstat (limited to 'backend/WeaponObject.cpp')
-rw-r--r--backend/WeaponObject.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/backend/WeaponObject.cpp b/backend/WeaponObject.cpp
index 58db34d..a91b6bf 100644
--- a/backend/WeaponObject.cpp
+++ b/backend/WeaponObject.cpp
@@ -1,10 +1,12 @@
#include "WeaponObject.h"
-void WeaponObject::set_damage_min(int damage_min) { this->damage_min = damage_min; }
-int WeaponObject::get_damage_min() const { return this->damage_min; }
-
-void WeaponObject::set_damage_max(int damage_max) { this->damage_max = damage_max; }
-int WeaponObject::get_damage_max() const { return this->damage_max; }
+void WeaponObject::set_damage(const Range<int> & range) {
+ this->damage_min = range.min;
+ this->damage_max = range.max;
+}
+Range<int> WeaponObject::get_damage() const {
+ return { this->damage_min, this->damage_max };
+}
const String & WeaponObject::get_displayname() const {
static String display = String::fmt("%s (%d - %d schade)", this->get_name().c_str(), this->damage_min, this->damage_max);