This commit is contained in:
Hanno Fleischer
2024-12-07 15:37:02 +01:00
65 changed files with 880923 additions and 313 deletions

View File

@@ -38,7 +38,7 @@ protected void handlePowerCard(PlayCardMessage msg) {
protected void throwPiece(Piece piece) {
logic.getGame().getBoard().getInfield()[logic.getGame().getBoard().getInfieldIndexOfPiece(piece)].clearOccupant();
logic.getGame().getPlayerByColor(piece.getColor()).addWaitingPiece(piece);
logic.addNotification(new ThrowPieceNotification(piece.getUuid()));
logic.addNotification(new ThrowPieceNotification(piece.getUuid(), piece.getColor()));
logic.getGame().getPlayerByColor(piece.getColor()).getPlayerStatistic().increasePiecesBeingThrown();
logic.getGame().getGameStatistics().increasePiecesBeingThrown();
piece.setState(PieceState.WAITING);

View File

@@ -1,5 +1,7 @@
package pp.mdga.notification;
import pp.mdga.game.Color;
import java.util.UUID;
/**
@@ -10,12 +12,14 @@ public class ThrowPieceNotification extends Notification {
* The id of the piece that was thrown.
*/
private final UUID pieceId;
private final Color throwColor;
/**
* This constructor is used to create a new ThrowPieceNotification
*/
public ThrowPieceNotification(UUID pieceId) {
public ThrowPieceNotification(UUID pieceId, Color throwColor) {
this.pieceId = pieceId;
this.throwColor = throwColor;
}
/**
@@ -26,4 +30,8 @@ public ThrowPieceNotification(UUID pieceId) {
public UUID getPieceId() {
return pieceId;
}
public Color getThrowColor() {
return throwColor;
}
}