From d1e7704d6632cad883f7dd8cf5083bc92d428cef Mon Sep 17 00:00:00 2001 From: Zsolt Tasnadi Date: Wed, 11 Mar 2026 23:32:35 +0100 Subject: [PATCH] Day documentation --- inc/logic/logic.day.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/inc/logic/logic.day.lua b/inc/logic/logic.day.lua index 36bf617..a3c450e 100644 --- a/inc/logic/logic.day.lua +++ b/inc/logic/logic.day.lua @@ -1,11 +1,18 @@ +--- @section Day local _day_increase_handlers = {} +--- Increases the day count and triggers registered handlers. +--- @within Day function Day.increase() Context.day_count = Context.day_count + 1 for _, handler in ipairs(_day_increase_handlers) do handler() end end + +--- Registers a handler to be called when the day increases. +--- @within Day +--- @param handler function The function to call when the day increases. function Day.register_handler(handler) table.insert(_day_increase_handlers, handler) end