Events: silly draft
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
---@alias Events.Callback fun(eventName:string, ...)
|
||||
|
||||
---@alias Events.Types
|
||||
--- 'ProcessingStationEvents'
|
||||
|
||||
--- ''
|
||||
---@class Events : Class
|
||||
---@field registeredEvents table<string, Events.Callback[]>
|
||||
Events = Class:extend({
|
||||
|
||||
@@ -7,15 +7,16 @@
|
||||
---@field call fun(self:Events.ProcessingStationEvents,eventName:Events.ProcessingStationEvents.EventName, ...)
|
||||
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)
|
||||
self:subscribe('on_push_container', callback)
|
||||
end
|
||||
|
||||
---@param pos MapVector
|
||||
---@param energy number
|
||||
function ProcessingStationEvents:callOnPushContainer(pos, energy)
|
||||
self:call('on_push_container', pos, energy)
|
||||
---@param pos MapVector
|
||||
---@param fuelGroup string
|
||||
---@param remainingFuel number
|
||||
function ProcessingStationEvents:callOnPushContainer(pos, fuelGroup, remainingFuel)
|
||||
self:call('on_push_container', pos, fuelGroup, remainingFuel)
|
||||
end
|
||||
|
||||
return ProcessingStationEvents
|
||||
|
||||
Reference in New Issue
Block a user