Add: [Script] Cloning ScriptList

This commit is contained in:
glx22
2025-05-26 18:50:06 +02:00
committed by Loïc Guilloux
parent 7200e7f509
commit 938acbe6ef
8 changed files with 58 additions and 1 deletions
+14
View File
@@ -453,6 +453,20 @@ bool ScriptList::LoadObject(HSQUIRRELVM vm)
return true;
}
ScriptObject *ScriptList::CloneObject()
{
ScriptList *clone = new ScriptList();
clone->CopyList(this);
return clone;
}
void ScriptList::CopyList(const ScriptList *list)
{
this->Sort(list->sorter_type, list->sort_ascending);
this->items = list->items;
this->buckets = list->buckets;
}
ScriptList::ScriptList()
{
/* Default sorter */