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