remove ai generated comments
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/pull_request_closed/woodpecker Pipeline was successful

This commit is contained in:
2026-02-18 19:29:06 +01:00
parent 6303781534
commit 1cf09de1fb
15 changed files with 56 additions and 155 deletions

View File

@@ -1,9 +1,5 @@
DesitionManager = {}
local _desitions = {}
local _desitions = {} -- Private table to store all desitions
-- Registers a decision object with the manager
-- desition: A table containing id, label, handle(), and condition()
function DesitionManager.register(desition)
if not desition or not desition.id then
PopupWindow.show({"Error: Invalid desition object registered (missing id)!"})
@@ -14,7 +10,6 @@ function DesitionManager.register(desition)
return
end
-- Ensure handle() and condition() methods exist with defaults if missing
if not desition.condition then
desition.condition = function() return true end
end
@@ -22,20 +17,15 @@ function DesitionManager.register(desition)
desition.handle = function() end
end
if _desitions[desition.id] then
-- Optional: warning if overwriting an existing desition
trace("Warning: Overwriting desition with id: " .. desition.id)
end
_desitions[desition.id] = desition
end
-- Retrieves a desition by its id
-- id: unique string identifier of the desition
-- Returns the desition object, or nil if not found
function DesitionManager.get(id)
return _desitions[id]
end
-- Optional: a way to get all registered desitions, if needed (e.g., for debug)
function DesitionManager.get_all()
return _desitions
end