Move XChunk processors to ZoneCommon

This commit is contained in:
Jan
2021-03-16 20:42:48 +01:00
parent ca1329323b
commit f22012d282
33 changed files with 383 additions and 317 deletions

View File

@ -12,5 +12,21 @@ IZoneWriterFactory* ZoneWriterFactories[]
bool ZoneWriting::WriteZone(std::ostream& stream, Zone* zone)
{
return true;
std::unique_ptr<ZoneWriter> zoneWriter;
for (auto* factory : ZoneWriterFactories)
{
if(factory->SupportsZone(zone))
{
zoneWriter = factory->CreateWriter(zone);
break;
}
}
if (zoneWriter == nullptr)
{
printf("Could not create ZoneWriter for zone '%s'.\n", zone->m_name.c_str());
return false;
}
return zoneWriter->WriteZone(stream);
}