12-24-2020, 04:33 PM
In pseudo-code should be something like this. I can't put an exact implementation because each language has its own way to deal with lists. Other languages like C don't even have native list, you have to provide your own implementation -or use a third party library-.
In this example, List and Item are ficticious elements -they don't exist in C-, but you got the idea.
In this example, List and Item are ficticious elements -they don't exist in C-, but you got the idea.
Code:
TLN_ObjectList objects = TLN_LoadObjectList("filename.tmx", "layer_name");
TLN_ObjectInfo info; // will hold data of queried objects
List dest_list = new List(); // create destination list
bool has_items = TLN_GetListObject(objects, &info); // query first object
while(has_items) { // iterate all items in objects list
Item item = new Item(); // create new item
// TODO: copy "info" data into created item
dest_list.add(item); // adds new item to destination list
has_items = TLN_GetListObject(objects, NULL); // query next object
}