diff options
Diffstat (limited to 'src/armor.cc')
-rw-r--r-- | src/armor.cc | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/armor.cc b/src/armor.cc index d7e7e57..3a429b3 100644 --- a/src/armor.cc +++ b/src/armor.cc @@ -8,6 +8,27 @@ using namespace std; namespace entry{ + struct armorImpl { + int ac; + std::string armor_type; + int strength; + bool disadvantage; + int cost; + double weight; + }; + NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(armorImpl, ac, armor_type, strength, disadvantage, cost, weight); + + NLOHMANN_FRIEND_DEFS(Item, Armor, data); + + Armor::Armor() : data(new armorImpl()) {} + + int Armor::getACBonus(void) const {return data->ac;} + std::string Armor::getArmorType(void) const {return data->armor_type;} + int Armor::getStrRequirement(void) const {return data->strength;} + bool Armor::stealthDisadvantage(void) const {return data->disadvantage;} + int Armor::getCost(void) const {return data->cost;} + double Armor::getWeight(void) const {return data->weight;} + string getTextHelper(const Armor& a, string dexBonusLight, string dexBonusMedium) { stringstream text; text << "AC: " << a.getACBonus(); @@ -30,7 +51,6 @@ namespace entry{ return getTextHelper(*this, "", ""); } - string Armor::getText(const creature::Creature& c) const { stringstream text; text << getName() << " (" << getType() << "): "; |