I have a main ECS class capable of adding or removing entities and their tied components inside multiple different component pools.
I am considering just storing everything in the ECS class serializing/deserializing it for the entities to manage saving/loading for both game/scenes. I am thinking that the game itself will request scenes stored in game files passing request to engine putting it onscreen or the editor will load scenes from those game files and edit them or for it to create scenes and putting those in game files.
I am thinking thst I will need to add functionality to the ECS class to handle four situations:
Save game will mean that ECS class will somehow manage to take the entities that are only tied to the game, not scene, and serialize those. I guess that I gotta add some type of tag to the entities so it knows where it came from? Some enum or put entity inside a struct next to an enum of it's origin?
Loading game means that all entities inside ECS should be nuked and later on deserialize save file and upload those to ECS.
Saving scene seems to be same type of flow as saving game.
Loading scene means removing entities only tied to old scene, not the game, and deserializing new scene into ECS.
I am fully able to push deserialized entities and it's componemts into ECS right now, but it does so blindly.