Version 1.0 #40

Merged
j23f0779 merged 947 commits from development2 into main 2024-12-13 10:26:49 +01:00
Showing only changes of commit 9f8fd9c22f - Show all commits

View File

@@ -29,6 +29,8 @@ public SwapState(ClientState parent, ClientGameLogic logic) {
this.parent = (PowerCardState) parent; this.parent = (PowerCardState) parent;
possibleOwnPieces = new ArrayList<>(); possibleOwnPieces = new ArrayList<>();
possibleEnemyPieces = new ArrayList<>(); possibleEnemyPieces = new ArrayList<>();
selectedOwnPiece = null;
selectedEnemyPiece = null;
} }
@Override @Override
@@ -37,15 +39,15 @@ public void enter() {
ArrayList<UUID> ownPieces = new ArrayList<>(possibleOwnPieces.stream().map(Piece::getUuid).toList()); ArrayList<UUID> ownPieces = new ArrayList<>(possibleOwnPieces.stream().map(Piece::getUuid).toList());
ArrayList<UUID> enemyPieces = new ArrayList<>(possibleEnemyPieces.stream().map(Piece::getUuid).toList()); ArrayList<UUID> enemyPieces = new ArrayList<>(possibleEnemyPieces.stream().map(Piece::getUuid).toList());
logic.addNotification(new SelectableSwapNotification(ownPieces, enemyPieces)); logic.addNotification(new SelectableSwapNotification(ownPieces, enemyPieces));
possibleOwnPieces = null; selectedOwnPiece = null;
possibleEnemyPieces = null; selectedEnemyPiece = null;
} }
@Override @Override
public void exit() { public void exit() {
LOGGER.log(System.Logger.Level.INFO, "Exiting SwapState"); LOGGER.log(System.Logger.Level.INFO, "Exiting SwapState");
possibleOwnPieces = null; possibleOwnPieces.clear();
possibleEnemyPieces = null; possibleEnemyPieces.clear();
} }
public void setPossibleOwnPieces(ArrayList<Piece> possibleOwnPieces) { public void setPossibleOwnPieces(ArrayList<Piece> possibleOwnPieces) {