diff options
author | Your Name <you@example.com> | 2021-04-15 15:23:23 -0400 |
---|---|---|
committer | Your Name <you@example.com> | 2021-04-15 15:23:23 -0400 |
commit | dfce4d0398a8bafbb7ad7a31345af181c0269c09 (patch) | |
tree | 695162ff8cc25e146f52d9e26fe19ffa9934b3d6 /src/creature.h | |
parent | 9034c3d2533177f7cb7a7ce939ec53f7fa63f60e (diff) | |
download | dmtool-dfce4d0398a8bafbb7ad7a31345af181c0269c09.tar.gz dmtool-dfce4d0398a8bafbb7ad7a31345af181c0269c09.tar.bz2 dmtool-dfce4d0398a8bafbb7ad7a31345af181c0269c09.zip |
Added spells
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; }; |