Commit 85b8b2ab authored by Paul Jeannot's avatar Paul Jeannot Committed by Quentin DRUAULT-AUBIN
Browse files

[Stats Pannel] Integration of the stat pannel when J1 or J2 plays

parent 1c05ca75
...@@ -544,9 +544,13 @@ public class InGameGUIController { ...@@ -544,9 +544,13 @@ public class InGameGUIController {
// (the better would be for data to have the boolean information // (the better would be for data to have the boolean information
// in a Mine returned with attack) // in a Mine returned with attack)
facade.getFacadeData().attack(cellToAttack, true); Pair<Integer, Ship> fireResult = facade.getFacadeData().attack(cellToAttack, true);
placeMine(cellToAttack,currentPlayer); placeMine(cellToAttack,currentPlayer);
// Update stats pannel
currentPlayerStats.turnPlayed((fireResult.getKey() == 1), (fireResult.getValue() != null));
updateStatsPannel();
// Reinitialize chrono for the next turn. // Reinitialize chrono for the next turn.
chronoTimeInit(); chronoTimeInit();
// End of my turn. // End of my turn.
...@@ -1129,6 +1133,10 @@ public class InGameGUIController { ...@@ -1129,6 +1133,10 @@ public class InGameGUIController {
// Change the CSS class of the cells. // Change the CSS class of the cells.
destroyShip(destroyedShip, playerGrid); destroyShip(destroyedShip, playerGrid);
} }
// Update stats pannel
opponentStats.turnPlayed(touched, (destroyedShip != null));
updateStatsPannel();
} }
/** /**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment