Serializer and Serializable #102

Closed
opened 2021-04-30 09:26:49 +02:00 by kazhnuz · 0 comments
Owner

For the moment, serialized files (gamesave, options and metadata) are handled by specific class using binser. It would be simpler to create parent class that would handle that, especially as with time we will add more options and feature to the game.

The following parent class could be that:

  • The Serializable class would be able to know it's serialized field (it would be a simple list of string). The getData functions would go in all the serializedFields list and return a table with all those fields, and if a field is a Serializable, it would return its getData. The setData would put data from a table in all those fields.
  • The Serialize would be a Serializable, that also contain a serialize and deserialize variables, that would simply put handle using binser to put data into a file.

This would cleanup a LOT of our code, and simplify a lot data saving. Metadata could be handled by a second serializer, that would read data from the game class and serialize/deserialize iteself each time the class save.

For the moment, serialized files (gamesave, options and metadata) are handled by specific class using binser. It would be simpler to create parent class that would handle that, especially as with time we will add more options and feature to the game. The following parent class could be that: - The Serializable class would be able to know it's serialized field (it would be a simple list of string). The getData functions would go in all the serializedFields list and return a table with all those fields, and if a field is a Serializable, it would return its getData. The setData would put data from a table in all those fields. - The Serialize would be a Serializable, that also contain a serialize and deserialize variables, that would simply put handle using binser to put data into a file. This would cleanup a LOT of our code, and simplify a lot data saving. Metadata could be handled by a second serializer, that would read data from the game class and serialize/deserialize iteself each time the class save.
kazhnuz added this to the Code Cleanup project 2021-04-30 09:26:50 +02:00
kazhnuz added the
2. Deliverable
4. Internals
labels 2021-04-30 09:27:38 +02:00
kazhnuz referenced this issue from a commit 2021-05-08 12:54:37 +02:00
Sign in to join this conversation.
No description provided.