ZoneLoading: Make ZoneDumper also generate a game specific zone file

This commit is contained in:
Jan 2019-11-18 21:42:02 +01:00
parent 73489ee455
commit d220aa8fde
4 changed files with 12 additions and 4 deletions

View File

@ -1,12 +1,14 @@
#pragma once #pragma once
#include "Zone/Zone.h" #include "Zone/Zone.h"
#include "Utils/FileAPI.h"
class IZoneDumper class IZoneDumper
{ {
public: public:
virtual ~IZoneDumper() = default; virtual ~IZoneDumper() = default;
virtual bool CanDumpZone(Zone* zone) = 0; virtual bool CanHandleZone(Zone* zone) = 0;
virtual bool DumpZone(Zone* zone, const std::string& basePath) = 0; virtual bool DumpZone(Zone* zone, const std::string& basePath) = 0;
virtual bool WriteZoneDefinition(Zone* zone, FileAPI::File* file, bool minimalistic) = 0;
}; };

View File

@ -7,7 +7,7 @@
#include "AssetDumpers/AssetDumperQdb.h" #include "AssetDumpers/AssetDumperQdb.h"
#include "AssetDumpers/AssetDumperScriptParseTree.h" #include "AssetDumpers/AssetDumperScriptParseTree.h"
bool ZoneDumperT6::CanDumpZone(Zone* zone) bool ZoneDumperT6::CanHandleZone(Zone* zone)
{ {
return zone->m_game == &game_t6; return zone->m_game == &game_t6;
} }
@ -76,3 +76,8 @@ bool ZoneDumperT6::DumpZone(Zone* zone, const std::string& basePath)
#undef DUMP_ASSET_POOL #undef DUMP_ASSET_POOL
} }
bool ZoneDumperT6::WriteZoneDefinition(Zone* zone, FileAPI::File* file, bool minimalistic)
{
return true;
}

View File

@ -4,6 +4,7 @@
class ZoneDumperT6 final : public IZoneDumper class ZoneDumperT6 final : public IZoneDumper
{ {
public: public:
bool CanDumpZone(Zone* zone) override; bool CanHandleZone(Zone* zone) override;
bool DumpZone(Zone* zone, const std::string& basePath) override; bool DumpZone(Zone* zone, const std::string& basePath) override;
bool WriteZoneDefinition(Zone* zone, FileAPI::File* file, bool minimalistic) override;
}; };

View File

@ -54,7 +54,7 @@ bool ZoneLoading::DumpZone(Zone* zone, const std::string& basePath)
{ {
for(auto dumper : zoneDumper) for(auto dumper : zoneDumper)
{ {
if(dumper->CanDumpZone(zone)) if(dumper->CanHandleZone(zone))
{ {
if(dumper->DumpZone(zone, basePath)) if(dumper->DumpZone(zone, basePath))
{ {