refactor: use OutputPathFilesystem for writing fastfiles

This commit is contained in:
Jan
2025-01-14 22:03:44 +01:00
parent a364e63258
commit cc67f6e730
34 changed files with 225 additions and 232 deletions

View File

@ -6,16 +6,16 @@
#include <format>
#include <iostream>
bool ZoneWriting::WriteZone(std::ostream& stream, Zone* zone)
bool ZoneWriting::WriteZone(std::ostream& stream, const Zone& zone)
{
const auto start = std::chrono::high_resolution_clock::now();
const auto factory = IZoneWriterFactory::GetZoneWriterFactoryForGame(zone->m_game->GetId());
const auto factory = IZoneWriterFactory::GetZoneWriterFactoryForGame(zone.m_game->GetId());
const auto zoneWriter = factory->CreateWriter(zone);
if (zoneWriter == nullptr)
{
std::cerr << std::format("Could not create ZoneWriter for zone \"{}\".\n", zone->m_name);
std::cerr << std::format("Could not create ZoneWriter for zone \"{}\".\n", zone.m_name);
return false;
}
@ -23,7 +23,7 @@ bool ZoneWriting::WriteZone(std::ostream& stream, Zone* zone)
const auto end = std::chrono::high_resolution_clock::now();
std::cout << std::format("Writing zone \"{}\" took {} ms.\n", zone->m_name, std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count());
std::cout << std::format("Writing zone \"{}\" took {} ms.\n", zone.m_name, std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count());
return result;
}