initial commit, 4.5 stable
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
This commit is contained in:
41
doc/classes/PackedDataContainerRef.xml
Normal file
41
doc/classes/PackedDataContainerRef.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="PackedDataContainerRef" inherits="RefCounted" deprecated="Use [method @GlobalScope.var_to_bytes] or [method FileAccess.store_var] instead. To enable data compression, use [method PackedByteArray.compress] or [method FileAccess.open_compressed]." xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
|
||||
<brief_description>
|
||||
An internal class used by [PackedDataContainer] to pack nested arrays and dictionaries.
|
||||
</brief_description>
|
||||
<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].
|
||||
[codeblock]
|
||||
var packed = PackedDataContainer.new()
|
||||
packed.pack([1, 2, 3, ["nested1", "nested2"], 4, 5, 6])
|
||||
|
||||
for element in packed:
|
||||
if element is PackedDataContainerRef:
|
||||
for subelement in element:
|
||||
print("::", subelement)
|
||||
else:
|
||||
print(element)
|
||||
[/codeblock]
|
||||
Prints:
|
||||
[codeblock lang=text]
|
||||
1
|
||||
2
|
||||
3
|
||||
::nested1
|
||||
::nested2
|
||||
4
|
||||
5
|
||||
6
|
||||
[/codeblock]
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="size" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
Returns the size of the packed container (see [method Array.size] and [method Dictionary.size]).
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
</class>
|
Reference in New Issue
Block a user