Compare commits
No commits in common. "25483be0ae8f29c8d4f59a5062d10a8a00156142" and "03987378c046d2dbb05e1340f1187a677b6d2d24" have entirely different histories.
25483be0ae
...
03987378c0
|
|
@ -51,9 +51,6 @@ class _SuperGameState extends State<SuperGame> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _checkValidChoice(List<TTCState> game, int index) =>
|
|
||||||
game[index] == TTCState.empty;
|
|
||||||
|
|
||||||
Widget _subGameDialog(int subGame) {
|
Widget _subGameDialog(int subGame) {
|
||||||
return Dialog(
|
return Dialog(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
|
@ -61,33 +58,13 @@ class _SuperGameState extends State<SuperGame> {
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Text(
|
||||||
padding: const EdgeInsets.only(bottom: 5),
|
|
||||||
child: Text(
|
|
||||||
"${Util.stateText(turn)} select cell",
|
"${Util.stateText(turn)} select cell",
|
||||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
TTCGame(
|
TTCGame(
|
||||||
turn: turn,
|
turn: turn,
|
||||||
cellOnTapCallback: (int i) {
|
cellOnTapCallback: (int i) {
|
||||||
if (!_checkValidChoice(data[subGame], i)) {
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) => AlertDialog(
|
|
||||||
content:
|
|
||||||
Text("${data[subGame][i].name.toUpperCase()}"
|
|
||||||
" already claimed "
|
|
||||||
"[${i % 3}, ${(i / 3).floor()}]"),
|
|
||||||
actions: [
|
|
||||||
ElevatedButton(
|
|
||||||
onPressed: () => Navigator.pop(context),
|
|
||||||
child: const Text("Close"))
|
|
||||||
],
|
|
||||||
));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
nextPlay = i;
|
nextPlay = i;
|
||||||
setState(() {
|
setState(() {
|
||||||
data[subGame][i] = turn;
|
data[subGame][i] = turn;
|
||||||
|
|
@ -97,9 +74,7 @@ class _SuperGameState extends State<SuperGame> {
|
||||||
},
|
},
|
||||||
data: data[subGame],
|
data: data[subGame],
|
||||||
),
|
),
|
||||||
Padding(
|
Row(
|
||||||
padding: const EdgeInsets.only(top: 5),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
|
|
@ -109,7 +84,6 @@ class _SuperGameState extends State<SuperGame> {
|
||||||
child: const Text("Close"))
|
child: const Text("Close"))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue