1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

added debug info to skill loading

This commit is contained in:
Henning Koehler 2017-08-23 10:19:30 +12:00
parent 993b7bf614
commit d8648288f0
2 changed files with 10 additions and 0 deletions

View File

@ -56,6 +56,12 @@ BonusList CSkill::getBonus(int level)
return bonusByLevel[level];
}
DLL_LINKAGE std::ostream & operator<<(std::ostream &out, const CSkill &skill)
{
out << "Skill(" << (int)skill.id << "," << skill.identifier << "): " << skill.bonusByLevel;
return out;
}
///CSkillHandler
CSkillHandler::CSkillHandler()
{
@ -109,6 +115,9 @@ CSkill * CSkillHandler::loadFromJson(const JsonNode & json, const std::string &
skill->addNewBonus(bonus, level);
}
}
CLogger * logger = CLogger::getLogger(CLoggerDomain("skills"));
logger->debugStream() << "loaded secondary skill " << identifier << "(" << (int)skill->id << ")";
logger->traceStream() << *skill;
return skill;
}

View File

@ -40,6 +40,7 @@ public:
}
friend class CSkillHandler;
friend std::ostream & operator<<(std::ostream &out, const CSkill &skill);
};
class DLL_LINKAGE CSkillHandler: public CHandlerBase<SecondarySkill, CSkill>