#include "assetFactory.h" #include "cuboid.h" #include "cylinder.h" #include "modelFactoryMesh_fwd.h" #include "object.h" #include "plane.h" #include "saxParse-persistence.h" #include AssetFactory::AssetFactory() : shapes { {"plane", std::make_shared()}, {"cuboid", std::make_shared()}, {"cylinder", std::make_shared()}, } { } std::shared_ptr AssetFactory::loadXML(const std::filesystem::path & filename) { filesystem::FileStar file {filename.c_str(), "r"}; return Persistence::SAXParsePersistence {}.loadState>(file); } bool AssetFactory::persist(Persistence::PersistenceStore & store) { using MapObjects = Persistence::MapByMember; return STORE_TYPE && STORE_NAME_HELPER("object", shapes, MapObjects); }