Class GGInventorySerializationStrategy extends Resource
Implements serialization/deserialization of inventory items for saving and sending them over the network.
Serialization turns [GGInventory] configuration and contents into a [Dictionary]. Deserialization is used to restore [GGInventory] configuration and contents from a [Dictionary].
The
The
Note: This strategy only deserializes [GGItemData] instances. If you're using custom classes that extend [GGItemData], you should use the [GGInventorySerializationStrategyDynamic] instead.
The
serialize() and deserialize() methods are invoked from a [GGInventory] instance according to its GGInventory.serialization_strategy.The
serialize_item() and deserialize_item() methods handle serialization/deserialization for each item in the inventory.Note: This strategy only deserializes [GGItemData] instances. If you're using custom classes that extend [GGItemData], you should use the [GGInventorySerializationStrategyDynamic] instead.
# Methods
## Returns a [Dictionary] that contains the [param inventory] state.func serialize(inventory: GGInventory) -> Dictionary## Restores the [param inventory] configuration and contents based on the provided [param state].func deserialize(inventory: GGInventorystate: Dictionary) -> void## Returns the [param item] state as [Dictionary] or [code]null[/code].func serialize_item(item: GGItemData) -> Variant## Returns a [GGItemData] instance (or [code]null[/code]) based on the provided [param state].func deserialize_item(state: Variant) -> Variant