Events: silly draft
This commit is contained in:
@@ -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({
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user