|
@@ -1,11 +1,24 @@
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
<class name="PoolColorArray" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
|
|
|
<brief_description>
|
|
|
- A pooled array of [Color].
|
|
|
+ A pooled array of [Color]s.
|
|
|
</brief_description>
|
|
|
<description>
|
|
|
An array specifically designed to hold [Color]. Optimized for memory usage, does not fragment the memory.
|
|
|
- [b]Note:[/b] This type is passed by value and not by reference.
|
|
|
+ [b]Note:[/b] This type is passed by value and not by reference. This means that when [i]mutating[/i] a class property of type [PoolColorArray] or mutating a [PoolColorArray] within an [Array] or [Dictionary], changes will be lost:
|
|
|
+ [codeblock]
|
|
|
+ var array = [PoolColorArray()]
|
|
|
+ array[0].push_back(Color(0.1, 0.2, 0.3, 0.4))
|
|
|
+ print(array) # [[]] (empty PoolColorArray within an empty Array)
|
|
|
+ [/codeblock]
|
|
|
+ Instead, the entire [PoolColorArray] property must be [i]reassigned[/i] with [code]=[/code] for it to be changed:
|
|
|
+ [codeblock]
|
|
|
+ var array = [PoolColorArray()]
|
|
|
+ var pool_array = array[0]
|
|
|
+ pool_array.push_back(Color(0.1, 0.2, 0.3, 0.4))
|
|
|
+ array[0] = pool_array
|
|
|
+ print(array) # [[(0.1, 0.2, 0.3, 0.4)]] (PoolColorArray with 1 element inside an Array)
|
|
|
+ [/codeblock]
|
|
|
</description>
|
|
|
<tutorials>
|
|
|
</tutorials>
|