public class Profile
extends java.lang.Object
implements com.badlogic.gdx.utils.Json.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
MAX_WORLD_SEED
Stores the max world seed that will be used to create the world.
|
Constructor and Description |
---|
Profile()
Creates a default profile with profileId = 0.
|
Profile(int id)
Creates a new profile starting from the beginning of the game.
|
Modifier and Type | Method and Description |
---|---|
void |
addScavengedLayerObject(GameObject gameObject)
Adds the given GameObject as a scavenged GameObject.
|
void |
addScavengedLayerObject(int row,
int col,
int objectId)
Adds a scavenged object to the TerrainLayer, specified with the layer's cell coordinates.
|
Inventory |
getInventory()
Retrieves the player's inventory, which contains all of the items collected by the player.
|
Loadout |
getLoadout()
Gets the loadout used by the player.
|
int |
getProfileId()
Returns the if of the profile, where 0 is the first profile shown in the world selection list
|
java.util.HashMap<java.lang.Integer,java.util.HashMap<java.lang.Integer,java.util.ArrayList<java.lang.Integer>>> |
getScavengedLayerObjects()
Returns a HashMap containing an array for each TerrainLayer.
|
java.util.ArrayList<java.lang.Integer> |
getScavengedLayerObjects(int row,
int col)
Returns a list of all of the objectIds that have been scavenged on the given TerrainLayer, denoted by its row and column.
|
int |
getTerrainColOffset()
Gets the terrain column offset which was saved to profile.
|
int |
getTerrainRowOffset()
Gets the terrain row offset which was saved to profile.
|
int |
getWorldSeed()
Returns the world seed used to procedurally generate the world.
|
void |
read(com.badlogic.gdx.utils.Json json,
com.badlogic.gdx.utils.JsonValue jsonData)
Indicates how a JSON file is read to be converted into a Profile object.
|
void |
setInventory(Inventory inventory)
Sets the player's inventory, which contains all of the items collected by the player.
|
void |
setLoadout(Loadout loadout)
Sets the loadout used by the player.
|
void |
setProfileId(int profileId)
Sets the profile Id of the profile.
|
void |
setScavengedLayerObjects(java.util.HashMap<java.lang.Integer,java.util.HashMap<java.lang.Integer,java.util.ArrayList<java.lang.Integer>>> scavengedLayerObjects)
Sets the HashMap containing objectId arrays for each TerrainLayer.
|
void |
setTerrainColOffset(int offset)
Sets the terrain column offset to be used the next time the game is loaded.
|
void |
setTerrainRowOffset(int offset)
Sets the terrain row offset to be used the next time the game is loaded.
|
void |
setWorldSeed(int worldSeed)
Sets the world seed of the profile.
|
java.lang.String |
toString()
Returns a string representation for the profile, used for each item of the world selection list from the world select screen.
|
void |
write(com.badlogic.gdx.utils.Json json)
Indicates how a Profile object is converted to a JSON file.
|
public static final int MAX_WORLD_SEED
public Profile()
public Profile(int id)
id
- ID of the profile we want to create. The first profile has ID 0, and is the first shown in the world selection list.public void setProfileId(int profileId)
public int getProfileId()
public void setWorldSeed(int worldSeed)
public int getWorldSeed()
public void setTerrainRowOffset(int offset)
public int getTerrainRowOffset()
public void setTerrainColOffset(int offset)
public int getTerrainColOffset()
public java.lang.String toString()
toString
in class java.lang.Object
public void write(com.badlogic.gdx.utils.Json json)
write
in interface com.badlogic.gdx.utils.Json.Serializable
public void read(com.badlogic.gdx.utils.Json json, com.badlogic.gdx.utils.JsonValue jsonData)
read
in interface com.badlogic.gdx.utils.Json.Serializable
public java.util.ArrayList<java.lang.Integer> getScavengedLayerObjects(int row, int col)
public void addScavengedLayerObject(GameObject gameObject)
public void addScavengedLayerObject(int row, int col, int objectId)
public Loadout getLoadout()
public void setLoadout(Loadout loadout)
public Inventory getInventory()
public void setInventory(Inventory inventory)
public java.util.HashMap<java.lang.Integer,java.util.HashMap<java.lang.Integer,java.util.ArrayList<java.lang.Integer>>> getScavengedLayerObjects()
public void setScavengedLayerObjects(java.util.HashMap<java.lang.Integer,java.util.HashMap<java.lang.Integer,java.util.ArrayList<java.lang.Integer>>> scavengedLayerObjects)