Class KeepColumnCard
java.lang.Object
ca.uqam.info.controller.KeepColumnCard
- All Implemented Interfaces:
ca.uqam.info.mgl7010.max.skyjo.controller.Command
public class KeepColumnCard
extends Object
implements ca.uqam.info.mgl7010.max.skyjo.controller.Command
Command implementation for keeping a column with all identical number in Skyjo game.
- Version:
- 3.1
- Author:
- Mohamed Latif Diallo, Hamza Afif, Ussel Sabbat
-
Constructor Summary
ConstructorsConstructorDescriptionKeepColumnCard(ca.uqam.info.mgl7010.max.skyjo.model.SkyjoModel model, int col) Constructs a new RevealCardCommand with the specified game model. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Executes the reveal card command by: 1.ca.uqam.info.mgl7010.max.skyjo.controller.Command[]Returns any follow-up commands that should be available after this command executes.booleanIndicates whether this command supports undo operations.toString()Returns the name of the commandvoidundo()Undo operation for this command.
-
Constructor Details
-
KeepColumnCard
public KeepColumnCard(ca.uqam.info.mgl7010.max.skyjo.model.SkyjoModel model, int col) Constructs a new RevealCardCommand with the specified game model.- Parameters:
model- the Skyjo game model instance, must not be nullcol- the column to keep
-
-
Method Details
-
execute
public void execute()Executes the reveal card command by: 1. Advancing to the next player's turn- Specified by:
executein interfaceca.uqam.info.mgl7010.max.skyjo.controller.Command
-
undo
public void undo()Undo operation for this command.- Specified by:
undoin interfaceca.uqam.info.mgl7010.max.skyjo.controller.Command
-
isUndoable
public boolean isUndoable()Indicates whether this command supports undo operations. Keep Colimn reveald no card so always true- Specified by:
isUndoablein interfaceca.uqam.info.mgl7010.max.skyjo.controller.Command- Returns:
- false as undo functionality is not implemented for TP2
-
getFollowUpCommands
public ca.uqam.info.mgl7010.max.skyjo.controller.Command[] getFollowUpCommands()Returns any follow-up commands that should be available after this command executes. For RevealCardCommand, no follow-up commands are provided as the turn ends.- Specified by:
getFollowUpCommandsin interfaceca.uqam.info.mgl7010.max.skyjo.controller.Command- Returns:
- empty array as the player's turn ends after revealing a card
-
toString
-