Kodi Development 22.0
for Binary and Script based Add-Ons
 
Loading...
Searching...
No Matches
5. Serialization operations

Detailed Description

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.

Function Documentation

◆ 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]dataThe buffer receiving the serialized game data
[in]sizeThe 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]dataA buffer containing the game's new state
[in]sizeThe size of the buffer
Returns
the error, or GAME_ERROR_NO_ERROR if the game deserialized