Package break_out.controller
Class JSONReader
- java.lang.Object
-
- break_out.controller.JSONReader
-
public class JSONReader extends java.lang.Object
TheJSONReader
reads the content of an json file.- Author:
- dmlux, modified by I.Schumacher
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Long
lifecount
The counter with the number of trials that are allowed to break out the stones of the levelprivate java.lang.String
path
The project path to the JSON fileprivate java.util.List<java.util.List<java.lang.Long>>
rects
The stones stored as List<List<Long>>private int[][]
stones
The stones stored as 2D-int-array
-
Constructor Summary
Constructors Constructor Description JSONReader(java.lang.String path)
The constructor needs an path to create the JSONReader
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getLifeCounter()
Getter for the lifeCounter of the JSON fileint[][]
getStones2DArray()
Getter for the stones of the JSON filejava.util.List<java.util.List<java.lang.Long>>
getStonesListOfLists()
Getter for the stones of the JSON fileprivate void
loadJsonValues()
Loader for the both values "fields" and "maxDrops" of the JSON file
-
-
-
Field Detail
-
path
private java.lang.String path
The project path to the JSON file
-
rects
private java.util.List<java.util.List<java.lang.Long>> rects
The stones stored as List<List<Long>>
-
stones
private int[][] stones
The stones stored as 2D-int-array
-
lifecount
private java.lang.Long lifecount
The counter with the number of trials that are allowed to break out the stones of the level
-
-
Method Detail
-
getStonesListOfLists
public java.util.List<java.util.List<java.lang.Long>> getStonesListOfLists()
Getter for the stones of the JSON file- Returns:
- The List<List<Long>> of stones
-
getStones2DArray
public int[][] getStones2DArray()
Getter for the stones of the JSON file- Returns:
- The stones as 2D-Array
-
getLifeCounter
public int getLifeCounter()
Getter for the lifeCounter of the JSON file- Returns:
- The lifeCounter
-
loadJsonValues
private void loadJsonValues()
Loader for the both values "fields" and "maxDrops" of the JSON file
-
-