Commit 22d5ca15 authored by Shaun Burch's avatar Shaun Burch 💻

#3 Disable board on win

parent 8d3ff8c7
Pipeline #23090126 passed with stages
in 6 minutes and 35 seconds
......@@ -89,9 +89,10 @@ public class MainActivity extends AppCompatActivity implements AddPlayerDialog.A
private void newGame() {
// Clear players
mPlayers = new ArrayList<>();
// Clear board
// Reset board
ButterKnife.apply(mBoardViews, (view, index) -> view.setImageDrawable(null));
// Get get players
ButterKnife.apply(mBoardViews, (view, index) -> view.setClickable(true));
// Get players
getPlayer(1);
}
......@@ -140,10 +141,10 @@ public class MainActivity extends AppCompatActivity implements AddPlayerDialog.A
}
private void checkForGameOver(Update update) {
// TODO Disable board on win
// Check for winning move
if (update.isWinner()) {
// Disable board on win
ButterKnife.apply(mBoardViews, (view, index) -> view.setClickable(false));
// TODO Dialog
String message = String.format("Player %1s has WON!!", update.getPlayer().getName());
Toast.makeText(this, message, Toast.LENGTH_LONG).show();
......
Markdown is supported
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