aboutsummaryrefslogtreecommitdiff
path: root/src/weapon.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/weapon.h')
-rw-r--r--src/weapon.h28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/weapon.h b/src/weapon.h
index da6700c..707edd9 100644
--- a/src/weapon.h
+++ b/src/weapon.h
@@ -11,6 +11,7 @@ namespace creature {
namespace entry {
class Weapon;
class Damage;
+ struct weaponImpl;
std::vector<rules::Ability> getAbilityOptions(const Weapon& w);
std::vector<Damage> rollDmg(const Weapon& w, bool versatile=false);
@@ -27,26 +28,21 @@ namespace entry {
class Weapon : public Item, public Substantial {
public:
- std::vector<Damage> getDamage(void) const {return damage;}
- std::set<std::string> getProperties(void) const {return properties;}
- std::string getWeaponType(void) const {return weapon_type;}
- std::pair<int, int> getRange(void) const {return range;}
- int getReach(void) const {return reach;}
- int getCost(void) const {return cost;}
- double getWeight(void) const {return weight;}
+ Weapon();
+
+ std::vector<Damage> getDamage(void) const;
+ std::set<std::string> getProperties(void) const;
+ std::string getWeaponType(void) const;
+ std::pair<int, int> getRange(void) const;
+ int getReach(void) const;
+ int getCost(void) const;
+ double getWeight(void) const;
virtual std::string getText() const override;
virtual std::string getText(const creature::Creature& c) const override;
- NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE(Item, Weapon, damage, properties, weapon_type, range, reach, cost, weight);
-
+ NLOHMANN_FRIEND_DECLARES(Weapon);
private:
- std::vector<Damage> damage;
- std::set<std::string> properties;
- std::string weapon_type;
- std::pair<int, int> range;
- int reach;
- int cost;
- double weight;
+ std::shared_ptr<weaponImpl> data;
};
}