Minor - Implements component serialization - V12.9.0

Adds serialization and deserialization functionality to the ECS component system.

This allows components to be saved and loaded, enabling scene persistence.
The IdentityComponent is updated to support serialization/deserialization.
The scene saving logic in scene_manager is updated to serialize components instead of hardcoded values.
This commit is contained in:
2025-09-06 14:18:28 +02:00
parent ccd0d045f9
commit 55e561fd14
6 changed files with 190 additions and 111 deletions

View File

@@ -33,8 +33,19 @@ public:
*/
virtual void Update(float deltaTime) {}
// virtual std::string Serialize() {}
// virtual void Deserialize(const std::string& data) {}
/**
* Serialize the component to a string (for debugging or saving).
* @return A string representation of the component.
*/
virtual std::string Serialize() const { return ""; }
/**
* Deserialize the component from a string (for loading).
* @param data The string data to deserialize from.
* @return True if deserialization was successful, otherwise false.
*/
virtual bool Deserialize(const std::string& data) { return false;}
};
/**