Merge commit
This commit is contained in:
@@ -11,11 +11,13 @@
|
|||||||
import pp.mdga.client.gamestate.turnstate.TurnStates;
|
import pp.mdga.client.gamestate.turnstate.TurnStates;
|
||||||
import pp.mdga.game.BonusCard;
|
import pp.mdga.game.BonusCard;
|
||||||
import pp.mdga.game.Piece;
|
import pp.mdga.game.Piece;
|
||||||
|
import pp.mdga.game.ShieldState;
|
||||||
import pp.mdga.game.card.HiddenCard;
|
import pp.mdga.game.card.HiddenCard;
|
||||||
import pp.mdga.game.card.ShieldCard;
|
import pp.mdga.game.card.ShieldCard;
|
||||||
import pp.mdga.game.card.SwapCard;
|
import pp.mdga.game.card.SwapCard;
|
||||||
import pp.mdga.game.card.TurboCard;
|
import pp.mdga.game.card.TurboCard;
|
||||||
import pp.mdga.message.server.*;
|
import pp.mdga.message.server.*;
|
||||||
|
import pp.mdga.notification.RemoveShieldNotification;
|
||||||
import pp.mdga.notification.AcquireCardNotification;
|
import pp.mdga.notification.AcquireCardNotification;
|
||||||
import pp.mdga.notification.DrawCardNotification;
|
import pp.mdga.notification.DrawCardNotification;
|
||||||
|
|
||||||
@@ -38,6 +40,12 @@ public TurnState(ClientState parent, ClientGameLogic logic) {
|
|||||||
@Override
|
@Override
|
||||||
public void enter() {
|
public void enter() {
|
||||||
this.setState(this.powerCardState);
|
this.setState(this.powerCardState);
|
||||||
|
for (Piece piece : logic.getGame().getPlayerByColor(logic.getGame().getActiveColor()).getPieces()) {
|
||||||
|
if (piece.isShielded() || piece.isSuppressed()){
|
||||||
|
piece.setShield(ShieldState.NONE);
|
||||||
|
logic.addNotification(new RemoveShieldNotification(piece.getUuid()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package pp.mdga.notification;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class RemoveShieldNotification extends Notification {
|
||||||
|
private final UUID pieceUuid;
|
||||||
|
|
||||||
|
public RemoveShieldNotification(UUID pieceUuid) {
|
||||||
|
this.pieceUuid = pieceUuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID getPieceUuid() {
|
||||||
|
return pieceUuid;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
package pp.mdga.server.automaton.game;
|
package pp.mdga.server.automaton.game;
|
||||||
|
|
||||||
|
import pp.mdga.game.Piece;
|
||||||
import pp.mdga.game.Player;
|
import pp.mdga.game.Player;
|
||||||
|
import pp.mdga.game.ShieldState;
|
||||||
import pp.mdga.message.client.*;
|
import pp.mdga.message.client.*;
|
||||||
import pp.mdga.server.ServerGameLogic;
|
import pp.mdga.server.ServerGameLogic;
|
||||||
import pp.mdga.server.automaton.GameState;
|
import pp.mdga.server.automaton.GameState;
|
||||||
@@ -52,6 +54,9 @@ public TurnState(GameState gameAutomaton, ServerGameLogic logic) {
|
|||||||
public void enter() {
|
public void enter() {
|
||||||
LOGGER.log(Level.INFO, "Entered TurnState state.");
|
LOGGER.log(Level.INFO, "Entered TurnState state.");
|
||||||
this.player = this.logic.getGame().getPlayerById(this.logic.getGame().getActivePlayerId());
|
this.player = this.logic.getGame().getPlayerById(this.logic.getGame().getActivePlayerId());
|
||||||
|
for (Piece piece : this.player.getPieces()) {
|
||||||
|
piece.setShield(ShieldState.NONE);
|
||||||
|
}
|
||||||
this.setCurrentState(this.powerCardState);
|
this.setCurrentState(this.powerCardState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ public PlayPowerCardState(TurnState turnAutomaton, ServerGameLogic logic) {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enter() {
|
public void enter() {
|
||||||
|
|
||||||
LOGGER.log(System.Logger.Level.DEBUG, "Entered PlayPowerCardState state.");
|
LOGGER.log(System.Logger.Level.DEBUG, "Entered PlayPowerCardState state.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user