Skip to content
Snippets Groups Projects
Commit 914a9774 authored by dragapsy's avatar dragapsy
Browse files

Tache 8 (1ere partie joué):

parent 54e8ecaa
No related branches found
No related tags found
No related merge requests found
...@@ -88,24 +88,20 @@ public class GameController { ...@@ -88,24 +88,20 @@ public class GameController {
} }
private void playComputerTurn(){ private void playComputerTurn(){
// TODO if (!game.hasEnded() && !game.isHumanTurn()){
// uncomment
// if (!game.hasEnded() && !game.isHumanTurn()){
//ComputerPlayer player = ((ComputerPlayer) game.getPlayer()); //ComputerPlayer player = ((ComputerPlayer) game.getPlayer());
// Flooder.flood(player.getStartCell(), player.play()); // Flooder.flood(player.getStartCell(), player.play());
// setScoreLabelTextProperty(); setScoreLabelTextProperty();
// pause.play(); pause.play();
// } }
} }
public void playHumanTurn(Color color){ public void playHumanTurn(Color color){
// TODO if(!game.hasEnded() && game.isHumanTurn()){
// uncomment Flooder.flood(game.getPlayer().getStartCell(), color);
// if(!game.hasEnded() && game.isHumanTurn()){ setScoreLabelTextProperty();
// Flooder.flood(game.getPlayer().getStartCell(), color); game.incrementTurn();
// setScoreLabelTextProperty(); }
// game.incrementTurn();
//}
} }
private void setPauseAnimation(){ private void setPauseAnimation(){
...@@ -117,10 +113,9 @@ public class GameController { ...@@ -117,10 +113,9 @@ public class GameController {
} }
private void setScoreLabelTextProperty() { private void setScoreLabelTextProperty() {
// TODO
// uncomment Player player = game.getPlayer();
// Player player = game.getPlayer(); scoreLabel.textProperty().setValue(Integer.toString(game.getPlayerScore(player)));
// scoreLabel.textProperty().setValue(Integer.toString(game.getPlayerScore(player)));
} }
...@@ -140,8 +135,7 @@ public class GameController { ...@@ -140,8 +135,7 @@ public class GameController {
@FXML @FXML
public void setPlayerHuman(){ public void setPlayerHuman(){
// TODO game.setPlayer(new HumanPlayer("human", getGridStartCell()));
// game.setPlayer(new HumanPlayer("human", getGridStartCell()));
} }
@FXML @FXML
......
...@@ -4,7 +4,7 @@ import javafx.scene.paint.Color; ...@@ -4,7 +4,7 @@ import javafx.scene.paint.Color;
public class Flooder { public class Flooder {
static void flood(Cell startCell, Color floodingColor){ public static void flood(Cell startCell, Color floodingColor){
ColoredCellIterator myCell = new ColoredCellIterator(startCell); ColoredCellIterator myCell = new ColoredCellIterator(startCell);
while (myCell.hasNext()) { while (myCell.hasNext()) {
...@@ -12,7 +12,7 @@ public class Flooder { ...@@ -12,7 +12,7 @@ public class Flooder {
} }
} }
static int coloredArea(Cell startCell){ public static int coloredArea(Cell startCell){
ColoredCellIterator cell = new ColoredCellIterator(startCell); ColoredCellIterator cell = new ColoredCellIterator(startCell);
int numberOfCellColored = 0; int numberOfCellColored = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment