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:
@@ -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;}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user