diff options
author | Your Name <you@example.com> | 2021-04-29 14:17:08 -0400 |
---|---|---|
committer | Your Name <you@example.com> | 2021-04-29 14:17:08 -0400 |
commit | 5a813a75412ac9b8fadb90c9abd46dd95aee8e9b (patch) | |
tree | 75c5466d459c793430a6481cd276a624cd843794 /src/weapon.h | |
parent | cd57ad6e208728bafcbc8c7d7b85d88603706978 (diff) | |
download | dmtool-5a813a75412ac9b8fadb90c9abd46dd95aee8e9b.tar.gz dmtool-5a813a75412ac9b8fadb90c9abd46dd95aee8e9b.tar.bz2 dmtool-5a813a75412ac9b8fadb90c9abd46dd95aee8e9b.zip |
Removed data files from repo
Diffstat (limited to 'src/weapon.h')
-rw-r--r-- | src/weapon.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/weapon.h b/src/weapon.h index 9ee2e8a..7a8c0ba 100644 --- a/src/weapon.h +++ b/src/weapon.h @@ -8,9 +8,13 @@ namespace creature { } namespace entry { + class Weapon; + + std::string genText(const Weapon& w, const creature::Creature& c); + class Weapon : public Item, public Substantial { public: - Weapon(const nlohmann::json& data, const nlohmann::json& base) : Item(base), damageType(data["damage"]["dmg_type"]), damageDieCount(data["damage"]["dmg_die_count"]), damageDieSides(data["damage"]["dmg_die_sides"]), properties(data["properties"]), weaponType(data["type"]), range(data["range"][0], data["range"][1]), reach(data["reach"]), cost(data["cost"]), weight(data["weight"]) {} + Weapon(const nlohmann::json& data, const nlohmann::json& base) : Item(base), damageType(data["damage"]["dmg_type"]), damageDieCount(data["damage"]["dmg_die_count"]), damageDieSides(data["damage"]["dmg_die_sides"]), properties(data["properties"]), weaponType(data["weapon_type"]), range(data["range"][0], data["range"][1]), reach(data["reach"]), cost(data["cost"]), weight(data["weight"]) {} std::string getDamageType(void) const {return damageType;} int getDamageDieCount(void) const {return damageDieCount;} @@ -21,8 +25,9 @@ namespace entry { int getReach(void) const {return reach;} int getCost(void) const {return cost;} double getWeight(void) const {return weight;} - - virtual std::string getText(const creature::Creature& c) const; + + virtual std::string getText() const override; + virtual std::string getText(const creature::Creature& c) const override {return genText(*this, c);} /*virtual nlohmann::json toJson(void) const { auto data = Item::toJson(); @@ -49,6 +54,4 @@ namespace entry { const int cost; const double weight; }; - - std::string genText(const Weapon& w, const creature::Creature& c); } |