1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

More fixes for stacks, some basic macro-based logging for bonus graph operations.

This commit is contained in:
Michał W. Urbańczyk
2010-12-11 23:11:26 +00:00
parent e677cd5b07
commit fc6d6e02a3
17 changed files with 143 additions and 69 deletions

View File

@@ -1038,6 +1038,21 @@ const CGHeroInstance * CStack::getMyHero() const
return NULL;
}
std::string CStack::nodeName() const
{
std::ostringstream oss;
oss << "Battle stack of " << count << " creatures of ";
if(type)
oss << type->namePl;
else
oss << "[UNDEFINED TYPE]";
oss << " from slot " << (int)slot;
if(base && base->armyObj)
oss << " of armyobj=" << base->armyObj->id;
return oss.str();
}
CGHeroInstance * CGameState::HeroesPool::pickHeroFor(bool native, int player, const CTown *town, std::map<ui32,CGHeroInstance *> &available, const CHeroClass *bannedClass /*= NULL*/) const
{
CGHeroInstance *ret = NULL;
@@ -4556,6 +4571,11 @@ PlayerState::PlayerState()
}
std::string PlayerState::nodeName() const
{
return "Player " + (color < VLC->generaltexth->capColors.size() ? VLC->generaltexth->capColors[color] : boost::lexical_cast<std::string>(color));
}
// void PlayerState::getParents(TCNodes &out, const CBonusSystemNode *root /*= NULL*/) const
// {
// return; //no loops possible