Updated 'PowerCardState' class.
Updated the 'PowerCardState' class by adding the 'SelectedPiecesMessage' handling to it.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
import pp.mdga.game.Piece;
|
||||
import pp.mdga.game.card.PowerCard;
|
||||
import pp.mdga.message.client.SelectedPiecesMessage;
|
||||
import pp.mdga.message.server.DiceNowMessage;
|
||||
import pp.mdga.message.server.PossibleCardsMessage;
|
||||
import pp.mdga.server.ServerGameLogic;
|
||||
@@ -85,6 +86,18 @@ public void addSelectedPiece(Piece piece) {
|
||||
this.selectedPieces.add(piece);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will be called whenever the server received an SelectedPiecesMessage message.
|
||||
* It will also get the client id of the player who send this message.
|
||||
*
|
||||
* @param msg as the message which was sent by the player as a SelectedPiecesMessage object.
|
||||
* @param from as the client id of the player as an Integer.
|
||||
*/
|
||||
@Override
|
||||
public void received(SelectedPiecesMessage msg, int from) {
|
||||
this.currentState.received(msg, from);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will be used to return currentState attribute of PowerCardState class.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user