fixed waitingpiece move
This commit is contained in:
@@ -49,7 +49,8 @@ public void received(SelectPieceMessage msg) {
|
||||
@Override
|
||||
public void received(WaitPieceMessage msg){
|
||||
LOGGER.log(System.Logger.Level.INFO, "Received WaitPieceMessage");
|
||||
logic.addNotification(new MovePieceNotification(msg.getPieceID(), logic.getGame().getPlayerByColor(logic.getGame().getActiveColor()).getStartNodeIndex(), true));
|
||||
Piece piece = logic.getGame().getPieceThroughUUID(msg.getPieceID());
|
||||
logic.addNotification(new SelectableMoveNotification(new ArrayList<>(List.of(msg.getPieceID())), new ArrayList<>(List.of(logic.getGame().getPlayerByColor(piece.getColor()).getStartNodeIndex())), new ArrayList<>(List.of(false))));
|
||||
parent.setState(parent.getWaitingPiece());
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ public SelectPieceState(ClientState parent, ClientGameLogic logic) {
|
||||
|
||||
@Override
|
||||
public void enter() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -39,7 +40,7 @@ public void setPossiblePieces(ArrayList<Piece> possiblePieces) {
|
||||
|
||||
@Override
|
||||
public void selectPiece(Piece piece) {
|
||||
if(possiblePieces.contains(piece)){
|
||||
if (possiblePieces.contains(piece)) {
|
||||
logic.send(new RequestMoveMessage(piece));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,9 +36,7 @@ public void exit() {
|
||||
|
||||
@Override
|
||||
public void selectPiece(Piece piece){
|
||||
if(moveablePiece.equals(piece)){
|
||||
logic.send(new RequestMoveMessage(piece));
|
||||
}
|
||||
logic.send(new RequestMoveMessage(piece));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user