|
|
@ -216,12 +216,16 @@ public class GameLogic extends JPanel { |
|
|
|
// waiting for mouse click event.... |
|
|
|
} else { |
|
|
|
|
|
|
|
Coordinate aiChosenField = this.aiLogic.chooseField(); |
|
|
|
Coordinate aiChosenField = null; |
|
|
|
while (aiChosenField == null) { |
|
|
|
aiChosenField = this.aiLogic.chooseField(); |
|
|
|
} |
|
|
|
|
|
|
|
aiChosenField.print(); |
|
|
|
aiChosenField.shoot(); |
|
|
|
gui.updateFields(); |
|
|
|
|
|
|
|
boolean aiHasNextMove = aiChosenField.getState() == Coordinate.HIT; |
|
|
|
boolean aiHasNextMove = aiChosenField.getState() != Coordinate.HIT; |
|
|
|
|
|
|
|
this.nextMove(aiHasNextMove); |
|
|
|
} |
|
|
|