I am trying to develop a simple AI for a Vassal game. I have chosen Borodino (S&T #32) to experiment on. I have developed my own java class which is in the Vmod and is invoked. In my code when “setup” is invoked and the boolean gameStaring is true I retrieve all the pieces that have a pieceCount greater than zero. I there someting I can set in the (Stack) pieces that will disable or intercept the selection of the pieces by players?
Vassal version 3.7.5
16 GB memory
Windows 11.
if (gameStarting) {
PieceWindow pice = modSave.getPieceWindow();
PlayerRoster play = modSave.getPlayerRoster();
GameState game = modSave.getGameState();
Collection<GamePiece> pieces = game.getAllPieces();
Collection<GameComponent> componenet = game.getGameComponents();
ArrayList<Stack> arrPieces = new ArrayList<>();
for (GamePiece gp : pieces) {
if (gp instanceof Stack){
Stack st = (Stack) gp;
if (st.getPieceCount() > 0) {
arrPieces.add(st);
}
}
}
}