Module RandomTrainSimWorld2.main
Class LocomotiveReader
java.lang.Object
com.github.freddyyj.randomtrainsimworld.config.RouteReader
public class LocomotiveReader extends Object
reader of all locomotive json file
This class reads all routes and locomotives from locomotives.json in jar. One object has one route, and its locomotives.
-
Method Summary
Modifier and Type Method Description String
getCode()
static LocomotiveReader
getLocomotiveReader(String code)
Get oneLocomotiveReader
object with route codestatic List<LocomotiveReader>
getLocomotiveReaders()
GetLocomotiveReader
listList<String>
getLocomotives()
Get locomotives list from this routeString
getName()
String
getNation()
static void
reload()
Reload locomotives.json
-
Method Details
-
reload
Reload locomotives.json- Throws:
IOException
-
getLocomotiveReaders
GetLocomotiveReader
list- Returns:
- LocomotiveReader list
-
getLocomotiveReader
Get oneLocomotiveReader
object with route code- Parameters:
code
- route code- Returns:
- LocomotiveReader object
-
getCode
-
getName
-
getNation
-
getLocomotives
Get locomotives list from this route- Returns:
- locomotive list
-