From 2ab51e507d620c4479e07ca0ec47d22c8c66bc90 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 13 Apr 2021 15:14:34 -0400 Subject: Initial commit --- src/weapon.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/weapon.h (limited to 'src/weapon.h') diff --git a/src/weapon.h b/src/weapon.h new file mode 100644 index 0000000..f09e8e5 --- /dev/null +++ b/src/weapon.h @@ -0,0 +1,35 @@ +#pragma once +#include "item.h" +#include "json.hpp" +#include + +namespace creature { + class Creature; +} + +namespace item { + class Weapon : public Item { + public: + Weapon(const nlohmann::json& data); + std::string getDamageType(void) const; + int getDamageDieCount(void) const; + int getDamageDieSides(bool versatile=false) const; + std::set getProperties(void) const; + std::string getWeaponType(void) const; + std::pair getRange(void) const; + int getReach(void) const; + + virtual nlohmann::json toJson(void) const; + + private: + const std::string damageType; + const int damageDieCount; + const int damageDieSides; + const std::set properties; + const std::string weaponType; + const std::pair range; + const int reach; + }; + + std::string genActionText(const Weapon& w, const creature::Creature& c); +} -- cgit v1.2.3