Browse Source

Expanded cell click logic

feature_TicTacToe_BasicPlayfield
kfkama 3 years ago
parent
commit
e684a87d66
  1. 4
      src/main/java/TicTacToe/cell.java
  2. 2
      src/test/java/TicTacToe/TicTacToeGameTest.java

4
src/main/java/TicTacToe/cell.java

@ -22,8 +22,11 @@ public class cell extends JButton {
}
protected void OnMouseClick() {
if(value == 0) {
value = ttt.player;
ttt.endTurn();
setEnabled(false);
switch (value) {
case 1: setBackground(new Color(255,0,0));
break;
@ -33,6 +36,7 @@ public class cell extends JButton {
break;
}
}
}

2
src/test/java/TicTacToe/TicTacToeGameTest.java

@ -5,6 +5,4 @@ import org.junit.jupiter.api.Test;
class TicTacToeGameTest {
}
Loading…
Cancel
Save