Module Train
Description
Module Status: Work in progress.
Usage:
local Train = require('__eradicators-library__/erlib/factorio/Train')()
LuaTrain
get_first_locomotive(train) | |
get_force(train) | |
get_position(train) |
TrainSchedule
Train.Schedule.remove_record(train_schedule, index) | |
Train.Schedule.add_record(train_schedule[, index], record) | |
Train.Schedule.remove_all_temporary_stops(train_schedule) |
LuaTrain
- get_first_locomotive(train)
-
Parameters:
- train LuaTrain
Returns:
- get_force(train)
-
Parameters:
- train LuaTrain
Returns:
-
LuaForce
The force of the first locomotive.
- get_position(train)
-
Parameters:
- train LuaTrain
Returns:
-
LuaPosition
The position of the first locomotive.
TrainSchedule
Important Note: Lua nil is a valid TrainSchedule, it represents a
schedule without any stations.
- Train.Schedule.remove_record(train_schedule, index)
-
Parameters:
- train_schedule TrainSchedule or nil
- index
NaturalNumber or string
Accepts string
"current"
instead of a number.
Returns:
-
TrainSchedule or nil
- Train.Schedule.add_record(train_schedule[, index], record)
-
Parameters:
- train_schedule TrainSchedule or nil
- index
NaturalNumber or string
Adds at end if not given, or
at current position if string
"current"
. (optional) - record TrainScheduleRecord
Returns:
-
TrainSchedule or nil
- Train.Schedule.remove_all_temporary_stops(train_schedule)
-
Parameters:
- train_schedule TrainSchedule or nil
Returns:
-
TrainSchedule or nil