mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-09 06:08:09 -06:00
76 lines
1.6 KiB
Lua
76 lines
1.6 KiB
Lua
--By Mami
|
|
|
|
--[[
|
|
global: {
|
|
total_ticks: int
|
|
layout_top_id: int
|
|
to_output: {[comb_unit_number]: LuaEntity}
|
|
to_stop: {[comb_unit_number]: LuaEntity}
|
|
stations: {[stop_id]: Station}
|
|
depots: {[stop_id]: LuaEntity}
|
|
trains: {[train_id]: Train}
|
|
trains_available: {[train_id]: bool}
|
|
layouts: {[layout_id]: Layout}
|
|
layout_train_count: {[layout_id]: int}
|
|
train_classes: {[string]: TrainClass}
|
|
}
|
|
Station: {
|
|
deliveries_total: int
|
|
priority: int
|
|
last_delivery_tick: int
|
|
r_threshold: int >= 0
|
|
p_threshold: int >= 0
|
|
locked_slots: int >= 0
|
|
entity_stop: LuaEntity
|
|
entity_comb1: LuaEntity
|
|
entity_comb2: LuaEntity?
|
|
wagon_combs: {[int]: LuaEntity}--allowed to be invalid entities
|
|
deliveries: {
|
|
[item_name]: int
|
|
}
|
|
deliveries: {
|
|
[item_name]: item-type
|
|
}
|
|
train_class: string
|
|
accepted_layouts: TrainClass
|
|
layout_pattern: string|nil
|
|
}
|
|
Train: {
|
|
entity: LuaEntity
|
|
layout_id: int
|
|
item_slot_capacity: int
|
|
fluid_capacity: int
|
|
depot_name: string
|
|
status: int
|
|
p_station_id: stop_id
|
|
r_station_id: stop_id
|
|
manifest: [{
|
|
name: string
|
|
type: string
|
|
count: int
|
|
}]
|
|
}
|
|
TrainClass: {
|
|
[layout_id]: bool
|
|
}
|
|
Layout: string
|
|
]]
|
|
--TODO: only init once
|
|
mod_settings = {}
|
|
mod_settings.tps = settings.global["cybersyn-ticks-per-second"].value
|
|
mod_settings.r_threshold = settings.global["cybersyn-request-threshold"].value
|
|
mod_settings.p_threshold = settings.global["cybersyn-provide-threshold"].value
|
|
|
|
global.total_ticks = 0
|
|
global.to_output = {}
|
|
global.stations = {}
|
|
global.depots = {}
|
|
global.trains = {}
|
|
global.trains_available = {}
|
|
global.layouts = {}
|
|
global.layout_train_count = {}
|
|
global.layout_top_id = 1
|
|
global.train_classes = {
|
|
[TRAIN_CLASS_ALL] = {},
|
|
}
|