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