diff --git a/TODO b/TODO index 216d128..253d011 100644 --- a/TODO +++ b/TODO @@ -5,6 +5,7 @@ major: do hardcore testing models & art add a refueling option on depots + move to an event based algorithm minor: railloader compat diff --git a/cybersyn/scripts/factorio-api.lua b/cybersyn/scripts/factorio-api.lua index 9a21e18..2396d08 100644 --- a/cybersyn/scripts/factorio-api.lua +++ b/cybersyn/scripts/factorio-api.lua @@ -21,7 +21,7 @@ end ---@param surface LuaSurface -local function se_get_space_elevator_name(surface) +function se_get_space_elevator_name(surface) --TODO: check how expensive the following is and potentially cache it's results local entity = surface.find_entities_filtered({ name = SE_ELEVATOR_STOP_PROTO_NAME, @@ -108,7 +108,7 @@ end ---@param elevator_name string ---@param is_train_in_orbit boolean -local function se_create_elevator_order(elevator_name, is_train_in_orbit) +function se_create_elevator_order(elevator_name, is_train_in_orbit) return {station = elevator_name..(is_train_in_orbit and SE_ELEVATOR_ORBIT_SUFFIX or SE_ELEVATOR_PLANET_SUFFIX)} end ---@param train LuaTrain diff --git a/cybersyn/scripts/global.lua b/cybersyn/scripts/global.lua index fd14273..532ffb0 100644 --- a/cybersyn/scripts/global.lua +++ b/cybersyn/scripts/global.lua @@ -76,8 +76,8 @@ ---@class Economy ---could contain invalid stations or stations with modified settings from when they were first appended ----@field public all_r_stations {[string]: uint[]} --{[network_name:item_name]: station_id} ----@field public all_p_stations {[string]: uint[]} --{[network_name:item_name]: station_id} +---@field public all_r_stations {[string]: uint[]} --{["network_name:item_name"]: station_id} +---@field public all_p_stations {[string]: uint[]} --{["network_name:item_name"]: station_id} ---@field public all_names (string|SignalID)[] --NOTE: any setting labeled as an interface setting can only be changed through the remote-interface, these settings are not save and have to be set at initialization diff --git a/cybersyn/scripts/remote-interface.lua b/cybersyn/scripts/remote-interface.lua index 5b8b889..1d0b04f 100644 --- a/cybersyn/scripts/remote-interface.lua +++ b/cybersyn/scripts/remote-interface.lua @@ -403,6 +403,20 @@ function interface.remove_available_train(train_id) remove_available_train(global, train_id, train) end +------------------------------------------------------------------ +--[[train schedule]] +------------------------------------------------------------------ + +interface.create_loading_order = create_loading_order +interface.create_unloading_order = create_unloading_order +interface.create_inactivity_order = create_inactivity_order +interface.create_direct_to_station_order = create_direct_to_station_order +interface.set_depot_schedule = set_depot_schedule +interface.lock_train = lock_train +interface.rename_manifest_schedule = rename_manifest_schedule +interface.se_get_space_elevator_name = se_get_space_elevator_name +interface.se_create_elevator_order = se_create_elevator_order +interface.set_manifest_schedule = set_manifest_schedule ------------------------------------------------------------------ --[[alerts]]