public class Malfunction extends RandomEvent
Modifier and Type | Field and Description |
---|---|
private int |
playerAffected |
private java.util.List<Tile> |
playerTiles |
private int |
roboticonTileNo |
private Roboticon |
roboticonToMalfunction |
private int[] |
startingRoboticonLevels |
private java.util.ArrayList<Tile> |
tilesWithRoboticons |
duration, randomiser
Constructor and Description |
---|
Malfunction(GameEngine gameEngine,
GameScreen gameScreen,
int playerToAffect) |
Modifier and Type | Method and Description |
---|---|
void |
eventEffect(boolean doOrUndo)
Overridden eventEffect() method initially found in the RandomEvent class.
|
java.lang.String |
eventMessage(boolean doOrUndo)
Overridden eventMessage() method initially found in the RandomEvent class.
|
private void |
gatherRoboticonTiles()
A method which gathers all player tiles which currently have roboticons stored on them.
|
Roboticon |
getRoboticonToMalfunction()
Gets the roboticon which will malfunction.
|
int[] |
getStartingRoboticonLevels()
Gets the roboticon production levels before the malfunction occurs.
|
java.lang.String |
toString()
Returns a string representation of a Malfunction random event.
|
decDuration, eventHappen, getDuration, getEventCooldown
private int playerAffected
private java.util.List<Tile> playerTiles
private java.util.ArrayList<Tile> tilesWithRoboticons
private int roboticonTileNo
private Roboticon roboticonToMalfunction
private int[] startingRoboticonLevels
public Malfunction(GameEngine gameEngine, GameScreen gameScreen, int playerToAffect)
public int[] getStartingRoboticonLevels()
public Roboticon getRoboticonToMalfunction()
public void eventEffect(boolean doOrUndo)
eventEffect
in class RandomEvent
doOrUndo:
- boolean determining whether to cause the event effect, or
reverse it. True -> Cause, False -> Reverse.public java.lang.String eventMessage(boolean doOrUndo)
eventMessage
in class RandomEvent
doOrUndo:
- boolean determining whether to cause the event effect, or
reverse it. True -> Cause, False -> Reverse.private void gatherRoboticonTiles()
public java.lang.String toString()
toString
in class java.lang.Object