PackedDataContainerRef

Inherits: RefCounted < Object

An internal class used by PackedDataContainer to pack nested arrays and dictionaries.

Description

When packing nested containers using PackedDataContainer, they are recursively packed into PackedDataContainerRef (only applies to Array and Dictionary). Their data can be retrieved the same way as from PackedDataContainer.

  1. var packed = PackedDataContainer.new()
  2. packed.pack([1, 2, 3, ["abc", "def"], 4, 5, 6])
  3. for element in packed:
  4. if element is PackedDataContainerRef:
  5. for subelement in element:
  6. print("::", subelement)
  7. else:
  8. print(element)
  9. # Prints:
  10. # 1
  11. # 2
  12. # 3
  13. # ::abc
  14. # ::def
  15. # 4
  16. # 5
  17. # 6

Methods

int

size ( ) const


Method Descriptions

int size ( ) const

Returns the size of the packed container (see Array.size and Dictionary.size).

Previous Next


© Copyright 2014-present Juan Linietsky, Ariel Manzur and the Godot community (CC BY 3.0). Revision 53e837c6.

Built with Sphinx using a theme provided by Read the Docs.