SCED/src/core/GUIDReferenceApi.ttslua

51 lines
1.8 KiB
Plaintext
Raw Normal View History

2023-10-18 14:55:38 -04:00
do
local GUIDReferenceApi = {}
local function getGuidHandler()
return getObjectFromGUID("123456")
end
-- Returns the matching object
2024-02-01 16:45:46 -05:00
---@param owner string Parent object for this search
---@param type string Type of object to search for
2024-02-01 20:03:25 -05:00
---@return any: Object reference to the matching object
2023-10-18 14:55:38 -04:00
GUIDReferenceApi.getObjectByOwnerAndType = function(owner, type)
return getGuidHandler().call("getObjectByOwnerAndType", { owner = owner, type = type })
end
-- Returns all matching objects as a table with references
2024-02-01 16:45:46 -05:00
---@param type string Type of object to search for
2024-02-01 20:03:25 -05:00
---@return table: List of object references to matching objects
2023-10-18 14:55:38 -04:00
GUIDReferenceApi.getObjectsByType = function(type)
return getGuidHandler().call("getObjectsByType", type)
end
-- Returns all matching objects as a table with references
2024-02-01 16:45:46 -05:00
---@param owner string Parent object for this search
2024-02-01 20:03:25 -05:00
---@return table: List of object references to matching objects
2023-10-18 14:55:38 -04:00
GUIDReferenceApi.getObjectsByOwner = function(owner)
return getGuidHandler().call("getObjectsByOwner", owner)
end
-- Sends new information to the reference handler to edit the main index
2024-02-01 16:45:46 -05:00
---@param owner string Parent of the object
---@param type string Type of the object
---@param guid string GUID of the object
2024-01-15 08:57:51 -05:00
GUIDReferenceApi.editIndex = function(owner, type, guid)
return getGuidHandler().call("editIndex", {
owner = owner,
type = type,
guid = guid
})
end
-- Returns the owner of an object or the object it's located on
---@param object tts__GameObject Object for this search
---@return string: Parent of the object or object it's located on
GUIDReferenceApi.getOwnerOfObject = function(object)
return getGuidHandler().call("getOwnerOfObject", object)
end
2023-10-18 14:55:38 -04:00
return GUIDReferenceApi
end