mod: entity prototype improvements and refactoring

- refactor and move queue & emitter classes for consistency
- don't emit all prototypes at once
- add simple queue for 'instant' packets so the printer doesn't get overwhelmed and mix up the output
This commit is contained in:
Adam 2022-07-09 14:03:57 +02:00
parent ae0eb98f12
commit 90aa086dd4
33 changed files with 742 additions and 652 deletions

View file

@ -1,8 +1,8 @@
local ____exports = {}
local ____EventDataCache = require("main.emitting.EventDataCache")
local EventUpdates = ____EventDataCache.default
local ____queue = require("main.queue.queue")
local Queue = ____queue.Queue
local ____EventDataCache = require("main.cache.EventDataCache")
local EventUpdatesManager = ____EventDataCache.default
local EventDataQueueManager = ____queue.EventDataQueueManager
function ____exports.initGlobal(force)
if force == nil then
force = false
@ -10,8 +10,8 @@ function ____exports.initGlobal(force)
log(("Initialising Kafkatorio Global variables (force=" .. tostring(force)) .. ")...")
global.MOD_VERSION = script.active_mods[script.mod_name]
global.FACTORIO_VERSION = script.active_mods.base
Queue.init(true)
EventUpdatesManager:init(true)
EventDataQueueManager:init(true)
EventUpdates:init(true)
log("Finished initialising Kafkatorio Global variables")
end
return ____exports