diff options
Diffstat (limited to 'src/creature.h')
-rw-r--r-- | src/creature.h | 43 |
1 files changed, 21 insertions, 22 deletions
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<std::string> 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<std::string, int> getSkills(void) const; std::map<std::string, int> getSaves(void) const; - std::vector<std::shared_ptr<feature::Feature>> getFeatures(void) const; - std::vector<std::shared_ptr<item::Item>> 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<std::string> 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<std::shared_ptr<feature::Feature>> getFeatures(void) const {return features;} + std::vector<std::shared_ptr<item::Item>> 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<std::string>& qualifiers); //void setScore(const std::string& ability, int score); void addInventoryItem(std::shared_ptr<item::Item> item); @@ -94,7 +93,7 @@ namespace creature { const std::vector<dmgType> dmgResistances; const std::vector<dmgType> dmgVulnerabilities; const std::vector<dmgType> condImmunities; - std::vector<std::shared_ptr<feature::Feature>> features; + const std::vector<std::shared_ptr<feature::Feature>> features; }; |