From 9f3802690f9dd9452e96d1d7a879291978d66e35 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 6 May 2021 14:13:28 -0400 Subject: Refactoring --- src/creature.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/creature.cc') diff --git a/src/creature.cc b/src/creature.cc index 21943fe..dcd2324 100644 --- a/src/creature.cc +++ b/src/creature.cc @@ -25,7 +25,7 @@ namespace creature { } Creature::Creature(const json& data, const json& base) - : Entry(base), inventory(json2ptrvec(data["inventory"])), stats(makeMap(data["stats"])), skills(makeMap(data["skills"])), proficiency(data["prof"]), size(data["size"]), alignment(data["alignment"]), hdCount(data["hit_die_count"]), hdSides(data["hit_die_sides"]), speed(data["speed"]), saves(json2vec(data["saves"])), langs(data["langs"]), cr(data["cr"]), natArmorName(data["natural_armor"]["name"]), natArmorBonus(data["natural_armor"]["bonus"]), dmgImmunities(json2vec(data["d_immunities"])), dmgResistances(json2vec(data["d_resistances"])), dmgVulnerabilities(json2vec(data["d_vulnerabilities"])), condImmunities(json2vec(data["c_immunities"])), features(json2ptrvec(data["features"])) + : Entry(base), inventory(utils::json2ptrvec(data["inventory"])), stats(makeMap(data["stats"])), skills(makeMap(data["skills"])), proficiency(data["prof"]), size(data["size"]), alignment(data["alignment"]), hdCount(data["hit_die_count"]), hdSides(data["hit_die_sides"]), speed(data["speed"]), saves(utils::json2vec(data["saves"])), langs(data["langs"]), cr(data["cr"]), natArmorName(data["natural_armor"]["name"]), natArmorBonus(data["natural_armor"]["bonus"]), dmgImmunities(utils::json2vec(data["d_immunities"])), dmgResistances(utils::json2vec(data["d_resistances"])), dmgVulnerabilities(utils::json2vec(data["d_vulnerabilities"])), condImmunities(utils::json2vec(data["c_immunities"])), features(utils::json2ptrvec(data["features"])) { // Initialize names and hp if(((map) data).contains("givenName")) { @@ -64,8 +64,8 @@ namespace creature { data["givenName"] = givenName; data["hpMax"] = hpMax; data["hp"] = hp; - data["inventory"] = ptrvec2json(inventory); - data["features"] = ptrvec2json(features); + data["inventory"] = utils::ptrvec2json(inventory); + data["features"] = utils::ptrvec2json(features); return data; } -- cgit v1.2.3