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 StringgetCode()static LocomotiveReadergetLocomotiveReader(String code)Get oneLocomotiveReaderobject with route codestatic List<LocomotiveReader>getLocomotiveReaders()GetLocomotiveReaderlistList<String>getLocomotives()Get locomotives list from this routeStringgetName()StringgetNation()static voidreload()Reload locomotives.json
-
Method Details
-
reload
Reload locomotives.json- Throws:
IOException
-
getLocomotiveReaders
GetLocomotiveReaderlist- Returns:
- LocomotiveReader list
-
getLocomotiveReader
Get oneLocomotiveReaderobject with route code- Parameters:
code- route code- Returns:
- LocomotiveReader object
-
getCode
-
getName
-
getNation
-
getLocomotives
Get locomotives list from this route- Returns:
- locomotive list
-