SCED/src/core/VictoryDisplayApi.ttslua

25 lines
885 B
Plaintext
Raw Normal View History

2023-06-14 22:17:55 +02:00
do
local VictoryDisplayApi = {}
2023-10-02 13:51:10 +02:00
local guidHandler = getObjectsWithTag("GUIDs")[1]
local function getVictoryDisplay()
return guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "VictoryDisplay" })
end
2023-06-14 22:17:55 +02:00
-- triggers an update of the Victory count
---@param delay Number Delay in seconds after which the update call is executed
VictoryDisplayApi.update = function(delay)
2023-10-02 13:51:10 +02:00
getVictoryDisplay().call("startUpdate", delay)
2023-06-14 22:17:55 +02:00
end
2023-06-15 23:18:17 +02:00
-- moves a card to the victory display (in the first empty spot)
---@param object Object Object that should be checked and potentially moved
VictoryDisplayApi.placeCard = function(object)
if object ~= nil and object.tag == "Card" then
2023-10-02 13:51:10 +02:00
getVictoryDisplay().call("getObjectByOwnerAndType", { owner = "Mythos", type = "VictoryDisplay" }).call("placeCard", object)
2023-06-15 23:18:17 +02:00
end
end
2023-06-14 22:17:55 +02:00
return VictoryDisplayApi
end