ZoneCommon: List zone content in the order it was loaded

This commit is contained in:
Jan
2020-02-19 14:10:50 +01:00
parent a7b59ea3d7
commit f0b66f0a35
11 changed files with 123 additions and 116 deletions

View File

@ -7,14 +7,13 @@ ContentPrinter::ContentPrinter(Zone* zone)
void ContentPrinter::PrintContent() const
{
const ZoneContent content = m_zone->GetPools()->GetContent();
printf("Zone '%s' (%s)\n", m_zone->m_name.c_str(), content.m_game_name.c_str());
const auto* pools = m_zone->GetPools();
printf("Zone '%s' (%s)\n", m_zone->m_name.c_str(), m_zone->m_game->GetName().c_str());
puts("Content:");
for(const auto& asset : content.m_assets)
for(const auto& asset : *pools)
{
printf("%s, %s\n", asset.m_asset_type_name.c_str(), asset.m_asset_name.c_str());
printf("%s, %s\n", pools->GetAssetTypeName(asset->m_type).c_str(), asset->m_name.c_str());
}
puts("");

View File

@ -30,10 +30,10 @@ void AbstractZoneDefWriter::WriteEntry(const std::string& entryKey, const std::s
void AbstractZoneDefWriter::WriteContent() const
{
auto zoneContent = m_zone->GetPools()->GetContent();
const auto* pools = m_zone->GetPools();
for(const auto& asset : zoneContent.m_assets)
for(const auto& asset : *pools)
{
WriteEntry(asset.m_asset_type_name, asset.m_asset_name);
WriteEntry(pools->GetAssetTypeName(asset->m_type), asset->m_name);
}
}