Commit f3af2a0c authored by Shaun Burch's avatar Shaun Burch 💻

Merge branch '3-multiplayer' into 'master'

Resolve "Multiplayer"

Closes #3

See merge request !7
parents a4db1a9a 22d5ca15
Pipeline #23090401 passed with stages
in 9 minutes and 2 seconds
......@@ -95,9 +95,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);
}
......@@ -146,10 +147,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