From dfce4d0398a8bafbb7ad7a31345af181c0269c09 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 15 Apr 2021 15:23:23 -0400 Subject: Added spells --- src/creature.h | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) (limited to 'src/creature.h') diff --git a/src/creature.h b/src/creature.h index 6ba8cca..88326f4 100644 --- a/src/creature.h +++ b/src/creature.h @@ -30,37 +30,36 @@ namespace creature { class Creature : public Jsonable { public: - Creature(json data); - virtual ~Creature(); + Creature(const json& data); + virtual ~Creature() {}; // Getters - std::string getCreatureName(void) const; - std::string getGivenName(void) const; - std::string getType(void) const; - std::string getSize(void) const; - std::string getAlignment(void) const; - double getCR(void) const; - std::string getLanguages(void) const; - int getHP(void) const; - int getHPMax(void) const; - std::vector getSenses(void) const; - std::string getSpeed(void) const; - int getScore(const std::string& ability) const; int getSkillBonus(const std::string& skill) const; int getAbilitySaveBonus(const std::string& ability) const; - int getProficiency(void) const; std::map getSkills(void) const; std::map getSaves(void) const; - std::vector> getFeatures(void) const; - std::vector> getInventory(void) const; // Inline getters - int getBonus(const std::string& ability) const { - return (int) (getScore(ability) - 10) / 2; - } + std::string getCreatureName(void) const {return creatureName;} + std::string getGivenName(void) const {return givenName;} + std::string getType(void) const {return type;} + std::string getSize(void) const {return size;} + std::string getAlignment(void) const {return alignment;} + double getCR(void) const {return cr;} + std::string getLanguages(void) const {return langs;} + int getHP(void) const {return hp;} + int getHPMax(void) const {return hpMax;} + std::vector getSenses(void) const {return senses;} + std::string getSpeed(void) const {return speed;} + int getScore(const std::string& ability) const {return stats.at(ability);} + int getBonus(const std::string& ability) const {return (int) (getScore(ability) - 10) / 2;} + int getProficiency(void) const {return proficiency;} + std::vector> getFeatures(void) const {return features;} + std::vector> getInventory(void) const {return inventory;} + // Setters (mutators) - void setGivenName(std::string); + void setGivenName(std::string name) {givenName = name;} void applyDamage(int amount, const std::string& type, const std::vector& qualifiers); //void setScore(const std::string& ability, int score); void addInventoryItem(std::shared_ptr item); @@ -94,7 +93,7 @@ namespace creature { const std::vector dmgResistances; const std::vector dmgVulnerabilities; const std::vector condImmunities; - std::vector> features; + const std::vector> features; }; -- cgit v1.2.3