fixed and added some tests

This commit is contained in:
Benjamin Feyer
2024-12-12 15:01:57 +01:00
parent 0d4685f3c2
commit 48d6516073
3 changed files with 102 additions and 95 deletions

View File

@@ -12,6 +12,7 @@
import pp.mdga.server.automaton.game.turn.ChoosePieceState;
import java.util.ArrayList;
import java.util.List;
public class SelectPieceState extends ChoosePieceAutomatonState {
/**
@@ -20,8 +21,8 @@ public class SelectPieceState extends ChoosePieceAutomatonState {
private static final System.Logger LOGGER = System.getLogger(SelectPieceState.class.getName());
private ArrayList<Piece> moveablePieces = new ArrayList<>();
private final ArrayList<Boolean> isHomeMove = new ArrayList<>();
private final ArrayList<Integer> targetIndex = new ArrayList<>();
private ArrayList<Boolean> isHomeMove = new ArrayList<>();
private ArrayList<Integer> targetIndex = new ArrayList<>();
/**
* Constructs a server state of the specified game logic.
@@ -178,4 +179,22 @@ public void exit() {
public ArrayList<Piece> getMoveablePieces() {
return moveablePieces;
}
/**
* this method is used to set the isHomeMoveIndex
*
* @param list to be set
*/
public void setIsHomeMove(ArrayList<Boolean> list){
this.isHomeMove=list;
}
/**
* this method is used to set the targetIndex
*
* @param list to be set
*/
public void setTargetIndex(ArrayList<Integer> list){
this.targetIndex=list;
}
}