working on matrix-animation

This commit is contained in:
Cedric Beck
2024-12-06 14:56:04 +01:00
parent f3816cb2a5
commit 2ac2de645b
8 changed files with 157 additions and 11 deletions

View File

@@ -42,7 +42,7 @@ protected void handlePowerCard(PlayCardMessage msg){
protected void throwPiece(Piece piece){
logic.getGame().getBoard().getInfield()[logic.getGame().getBoard().getInfieldIndexOfPiece(piece)].clearOccupant();
logic.getGame().getBoard().getPlayerData().get(piece.getColor()).addWaitingPiece(piece);
logic.addNotification(new ThrowPieceNotification(piece.getUuid()));
// logic.addNotification(new ThrowPieceNotification(piece.getUuid()));
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;
}
}