Reimplementing save/load file

This commit is contained in:
Yousef Khadadeh 2026-01-01 22:46:02 +03:00
parent 260288a1b0
commit 9913eb6c8e
37 changed files with 437 additions and 350 deletions

View file

@ -43,3 +43,15 @@ void CanvasComponentAllocator::register_class(World& world) {
}
});
}
void CanvasComponentAllocator::save_file(cereal::PortableBinaryOutputArchive& a) const {
a(comp->get_type());
comp->save_file(a);
}
void CanvasComponentAllocator::load_file(cereal::PortableBinaryInputArchive& a, VersionNumber version) {
CanvasComponentType t;
a(t);
comp = std::unique_ptr<CanvasComponent>(CanvasComponent::allocate_comp(t));
comp->load_file(a, version);
}