added 2 methods for Test usage in Board and PlayerData

This commit is contained in:
Hanno Fleischer
2024-11-16 13:31:56 +01:00
parent ee59807395
commit 6b2d775534
2 changed files with 20 additions and 0 deletions

View File

@@ -47,4 +47,14 @@ public Map<Color, PlayerData> getPlayerData() {
public Node[] getInfield() {
return infield;
}
/**
* This method sets a piece on a specific Node in the infield
*
* @param index the index of the node
* @param piece the piece to be set
*/
public void setPieceOnBoard(int index, Piece piece) {
infield[index].setOccupant(piece);
}
}

View File

@@ -98,4 +98,14 @@ public Piece removePieceFromWaitingArea() {
}
return null;
}
/**
* This method sets a piece at the given index in the home area
*
* @param index the index of the node
* @param piece the piece to be set at the given index
*/
public void setPieceInHome(int index, Piece piece) {
homeNodes[index].setOccupant(piece);
}
}