Package com.mygdx.game.Logic
Class DataProvider
java.lang.Object
com.mygdx.game.Logic.DataProvider
public class DataProvider
extends java.lang.Object
Contains Methods that parse data from files and return lists of objects
-
Constructor Summary
Constructors Constructor Description DataProvider()
-
Method Summary
Modifier and Type Method Description static Card
drawCard()
static java.util.ArrayList<CourseSquare>
getCourses()
You must first runreadCourses(InputStream)
or the list will be emptystatic java.util.ArrayList<Pawn>
getPawns()
static GameInstance
loadGame(java.io.InputStream stream)
static void
readCards(java.io.InputStream moveStream, java.io.InputStream moneyStream, java.io.InputStream jailStream)
static void
readCourses(java.io.InputStream stream)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
DataProvider
public DataProvider()
-
-
Method Details
-
loadGame
- Parameters:
stream
- file stream of serializedGameInstance
Object- Returns:
- the deserialized
GameInstance
Object
-
getPawns
- Returns:
- a list of the default Monopoly pawns
-
readCourses
public static void readCourses(java.io.InputStream stream)- Parameters:
stream
- the stream of a .csv file with data to constructCourseSquare
Objects- See Also:
- here for the Google Sheet that the .csv was exported from
-
getCourses
You must first runreadCourses(InputStream)
or the list will be empty- Returns:
- a list of
CourseSquare
-
readCards
public static void readCards(java.io.InputStream moveStream, java.io.InputStream moneyStream, java.io.InputStream jailStream) -
drawCard
-