Serialization operations
Serialization operation parts in interface:
Copy this to your project and extend with your parts or leave functions complete away where not used or supported.
◆ SerializeSize()
virtual size_t SerializeSize |
( |
| ) |
|
|
inlinevirtual |
Get the number of bytes required to serialize the game.
- Returns
- the number of bytes, or 0 if serialization is not supported
◆ Serialize()
virtual GAME_ERROR Serialize |
( |
uint8_t * | data, |
|
|
size_t | size ) |
|
inlinevirtual |
Serialize the state of the game.
- Parameters
-
[in] | data | The buffer receiving the serialized game data |
[in] | size | The size of the buffer |
- Returns
- the error, or GAME_ERROR_NO_ERROR if the game was serialized into the buffer
◆ Deserialize()
virtual GAME_ERROR Deserialize |
( |
const uint8_t * | data, |
|
|
size_t | size ) |
|
inlinevirtual |
Deserialize the game from the given state.
- Parameters
-
[in] | data | A buffer containing the game's new state |
[in] | size | The size of the buffer |
- Returns
- the error, or GAME_ERROR_NO_ERROR if the game deserialized