MCPcopy Create free account
hub / github.com/Tencent/UnLua / ToArray

Method ToArray

Plugins/UnLua/Source/UnLua/Private/Containers/LuaSet.h:209–228  ·  view source on GitHub ↗

* Convert this set to an array * * @param OutArray - the result array */

Source from the content-addressed store, hash-verified

207 * @param OutArray - the result array
208 */
209 FORCEINLINE FLuaArray* ToArray(void *OutArray) const
210 {
211 if (ElementInterface && OutArray)
212 {
213 FScriptArray *ScriptArray = new FScriptArray;
214 //ArrayProperty->InitializeValue(ScriptArray); // do nothing...
215 FLuaArray *LuaArray = new(OutArray) FLuaArray(ScriptArray, ElementInterface, FLuaArray::OwnedBySelf);
216 int32 i = -1, Size = Set->Num();
217 while (Size > 0)
218 {
219 if (IsValidIndex(++i))
220 {
221 LuaArray->Add(Set->GetData(i, SetLayout));
222 --Size;
223 }
224 }
225 return LuaArray;
226 }
227 return nullptr;
228 }
229
230 FScriptSet *Set;
231 FScriptSetLayout SetLayout;

Callers 2

TSet_ToArrayFunction · 0.80
TSet_ToTableFunction · 0.80

Calls 3

NumMethod · 0.45
AddMethod · 0.45
GetDataMethod · 0.45

Tested by

no test coverage detected