Add:No Optional Card
This commit is contained in:
@@ -104,6 +104,16 @@ public class ClientController {
|
||||
client.doEvent(new PickOptionalBuildingCard(playerUsername,pos));
|
||||
}
|
||||
|
||||
/**
|
||||
* Refuse to pick an optional building card for the specified player.
|
||||
* @param playerUsername the username of the player performing the action.
|
||||
* @return {@code true} if the action succeeds, {@code false} if the player does not exist
|
||||
* or if the pick operation fails.
|
||||
*/
|
||||
public void noOptionalCard(String playerUsername) {
|
||||
client.doEvent(new NoOptionalCard(playerUsername));
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to perform the slot choice action for the specified player at the specified position.
|
||||
*
|
||||
|
||||
@@ -147,6 +147,18 @@ public class GameController {
|
||||
return false;
|
||||
return model.PickOptionalBuildingCard(model.getPlayerByUsername(playerUsername), pos);
|
||||
}
|
||||
/**
|
||||
* Refuse to pick an optional building card for the specified player.
|
||||
* @param playerUsername the username of the player performing the action.
|
||||
* @return {@code true} if the action succeeds, {@code false} if the player does not exist
|
||||
* or if the pick operation fails.
|
||||
*/
|
||||
public boolean noOptionalCard(String playerUsername) {
|
||||
Player player= model.getPlayerByUsername(playerUsername);
|
||||
if(player==null)
|
||||
return false;
|
||||
return model.NoOptionalCard(model.getPlayerByUsername(playerUsername));
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to perform the slot choice action for the specified player at the specified position.
|
||||
|
||||
Reference in New Issue
Block a user