public class Roboticon
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private Tile |
CurrentTile
Variable holding what tile the roboticon is stored on.
|
private int |
energyLevel
Holds the current energy-generating level of the Roboticon
|
private int |
foodLevel
Holds the current food-growing level of the Roboticon
|
private com.badlogic.gdx.scenes.scene2d.ui.Image |
icon
The image object providing the roboticon's visual representation
|
private com.badlogic.gdx.graphics.Texture |
iconTexture
The texture encoding the roboticon's visual representation
|
private int |
MaxLevel
int variable determining the maximum level of roboticons allowed in the game.
|
private int |
oreLevel
Holds the current ore-mining level of the Roboticon
|
private int |
RoboticonID
Unique numerical identifier of the roboticon.
|
private int[] |
Upgrades
Upgrade array, holds the possible levels of upgrade for the current robot.
|
Constructor and Description |
---|
Roboticon(int ID,
Player Player,
Tile Tile)
Constructor of the class
|
Modifier and Type | Method and Description |
---|---|
int |
getEnergyUpgradeCost()
Provides the roboticon's current energy-generating upgrade cost
|
int |
getFoodUpgradeCost()
Provides the roboticon's current food-growing upgrade cost
|
com.badlogic.gdx.scenes.scene2d.ui.Image |
getIcon()
Returns an Image object with the texture of the roboticon's icon mapped to it
|
com.badlogic.gdx.graphics.Texture |
getIconTexture()
Returns the texture file encoding the roboticon's icon
|
int[] |
getLevel()
Function to get the current roboticon Level
|
int |
getMaxLevel()
Provides the maximum level to which this roboticon can be upgraded to (across all three individual upgrade types)
|
int |
getOreUpgradeCost()
Provides the roboticon's current ore-mining upgrade cost
|
int |
getRoboticonID() |
int[] |
possibleUpgrades()
A method to return an array of all possible upgrades available to the roboticon at its current state
|
int[] |
productionModifier()
A method to return the production modifier offered by the roboticon.
|
void |
setEnergyLevel(int newLevel)
Setter for energyLevel
New in Assessment 3
|
void |
setFoodLevel(int newLevel)
Setter for foodLevel
New in Assessment 3
|
void |
setOreLevel(int newLevel)
Setter for oreLevel
New in Assessment 3
|
void |
upgrade(int resource)
Method to upgrade a single level of the roboticon.
|
private int RoboticonID
private Tile CurrentTile
private int MaxLevel
private int oreLevel
private int energyLevel
private int foodLevel
private int[] Upgrades
private com.badlogic.gdx.scenes.scene2d.ui.Image icon
private com.badlogic.gdx.graphics.Texture iconTexture
public int[] getLevel()
public void setOreLevel(int newLevel)
newLevel
- public void setEnergyLevel(int newLevel)
newLevel
- public void setFoodLevel(int newLevel)
newLevel
- public int getRoboticonID()
public void upgrade(int resource)
The parameter 'Resource' specifies 'Ore', 'Energy' or 'Food' to be upgraded one level.
Changed in Assessment 3 - refactored to use switch statement instead of if-else 0: ORE 1: ENERGY 2: FOODpublic int[] possibleUpgrades()
public int[] productionModifier()
Contains inherent randomness, not just a 1:1 ratio of level to return each phase of production. The modifier is used outside of this class to multiply the inherent resources located on that tile.
public com.badlogic.gdx.scenes.scene2d.ui.Image getIcon()
public com.badlogic.gdx.graphics.Texture getIconTexture()
public int getOreUpgradeCost()
public int getFoodUpgradeCost()
public int getEnergyUpgradeCost()
public int getMaxLevel()