Events: silly draft

This commit is contained in:
Van
2026-06-06 22:41:28 +03:00
parent 9a3ea9d0c4
commit 91cb3f1d6d
2 changed files with 7 additions and 7 deletions

View File

@@ -1,8 +1,7 @@
---@alias Events.Callback fun(eventName:string, ...) ---@alias Events.Callback fun(eventName:string, ...)
---@alias Events.Types ---@alias Events.Types
--- 'ProcessingStationEvents' --- ''
---@class Events : Class ---@class Events : Class
---@field registeredEvents table<string, Events.Callback[]> ---@field registeredEvents table<string, Events.Callback[]>
Events = Class:extend({ Events = Class:extend({

View File

@@ -7,15 +7,16 @@
---@field call fun(self:Events.ProcessingStationEvents,eventName:Events.ProcessingStationEvents.EventName, ...) ---@field call fun(self:Events.ProcessingStationEvents,eventName:Events.ProcessingStationEvents.EventName, ...)
local ProcessingStationEvents = Events:extend() local ProcessingStationEvents = Events:extend()
---@param callback fun(eventName:Events.ProcessingStationEvents.EventName, pos:MapVector, energy:number) ---@param callback fun(eventName:Events.ProcessingStationEvents.EventName, pos:MapVector, fuelGroup:string, remainingFuel:number)
function ProcessingStationEvents:subscribeOnPushContainer(callback) function ProcessingStationEvents:subscribeOnPushContainer(callback)
self:subscribe('on_push_container', callback) self:subscribe('on_push_container', callback)
end end
---@param pos MapVector ---@param pos MapVector
---@param energy number ---@param fuelGroup string
function ProcessingStationEvents:callOnPushContainer(pos, energy) ---@param remainingFuel number
self:call('on_push_container', pos, energy) function ProcessingStationEvents:callOnPushContainer(pos, fuelGroup, remainingFuel)
self:call('on_push_container', pos, fuelGroup, remainingFuel)
end end
return ProcessingStationEvents return ProcessingStationEvents