Class Prometheus
java.lang.Object
it.polimi.ingsw.server.controller.god.God
it.polimi.ingsw.server.controller.god.Prometheus
public class Prometheus extends God
Represents the card of the God Prometheus.
Allows to follow the instructions and to apply the effect of this specific God.
-
Field Summary
Fields Modifier and Type Field Description java.lang.Stringdescription -
Constructor Summary
Constructors Constructor Description Prometheus(GodController godController) -
Method Summary
Modifier and Type Method Description voidevolveTurn(Worker worker)The evolution of the turn for the player that holds the Prometheus God card is different from the abstract implementation.java.lang.StringgetDescription()GodControllergetGodController()voidmove(Worker worker)As the default god's move, but if the player decided to not move up, the worker cannot actually do it.WorkerMoveMapupdateMoveMap(Worker worker)Sets the permissions to move of the selected worker.Methods inherited from class it.polimi.ingsw.server.controller.god.God
build, toString, updateBuildMap, win
-
Field Details
-
description
public final java.lang.String description- See Also:
- Constant Field Values
-
-
Constructor Details
-
Method Details
-
evolveTurn
public void evolveTurn(Worker worker) throws UnableToMoveException, UnableToBuildException, WinExceptionThe evolution of the turn for the player that holds the Prometheus God card is different from the abstract implementation. Takes also into account that the selected worker can build before moving.- Overrides:
evolveTurnin classGod- Parameters:
worker- Selected worker that will act in the current turn.- Throws:
UnableToBuildException- The worker isn't allowed to build anywhere.UnableToMoveException- The worker isn't allowed to move anywhere.WinException- The worker has reached the third level of a building and so wins the game.
-
move
As the default god's move, but if the player decided to not move up, the worker cannot actually do it.- Overrides:
movein classGod- Parameters:
worker- Selected worker that will move.- Throws:
UnableToMoveException- The worker isn't allowed to move anywhere.
-
updateMoveMap
Sets the permissions to move of the selected worker. It is called at the beginning of each move, which will then comply with the matrix.- Overrides:
updateMoveMapin classGod- Parameters:
worker- worker playing the turn.- Returns:
- The WorkerMoveMap of the worker chosen for this turn.
- Throws:
UnableToMoveException- signals that the worker cannot move anywhere
-
getGodController
- Overrides:
getGodControllerin classGod
-
getDescription
public java.lang.String getDescription()- Specified by:
getDescriptionin classGod
-