90 lines
2.9 KiB
Dart
90 lines
2.9 KiB
Dart
// import 'package:flutter/material.dart';
|
|
// import '../models/gamingbloob.dart';
|
|
|
|
// class WerewolfGame extends StatefulWidget {
|
|
// @override
|
|
// _WerewolfGameState createState() => _WerewolfGameState();
|
|
// }
|
|
|
|
// class _WerewolfGameState extends State<WerewolfGame> {
|
|
// final Game game = Game(1); // Initial number of wolves
|
|
// final TextEditingController _playerController = TextEditingController();
|
|
|
|
// @override
|
|
// Widget build(BuildContext context) {
|
|
// return Scaffold(
|
|
// body: Column(
|
|
// children: [
|
|
// Padding(
|
|
// padding: const EdgeInsets.all(8.0),
|
|
// child: TextField(
|
|
// controller: _playerController,
|
|
// decoration: InputDecoration(labelText: 'Spielername'),
|
|
// onSubmitted: (value) {
|
|
// setState(() {
|
|
// game.addPlayer(value);
|
|
// _playerController.clear();
|
|
// });
|
|
// },
|
|
// ),
|
|
// ),
|
|
// Row(
|
|
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
// children: [
|
|
// FloatingActionButton(
|
|
// onPressed: () {
|
|
// setState(() {
|
|
// game.decrementWolves();
|
|
// });
|
|
// },
|
|
// child: Icon(Icons.remove),
|
|
// mini: true,
|
|
// ),
|
|
// Text('Anzahl der Werwölfe: ${game.numWolves}',
|
|
// style: TextStyle(fontSize: 16)),
|
|
// FloatingActionButton(
|
|
// onPressed: () {
|
|
// setState(() {
|
|
// game.incrementWolves();
|
|
// });
|
|
// },
|
|
// child: Icon(Icons.add),
|
|
// mini: true,
|
|
// ),
|
|
// ],
|
|
// ),
|
|
// ElevatedButton(
|
|
// onPressed: () {
|
|
// setState(() {
|
|
// game.assignRoles();
|
|
// });
|
|
// },
|
|
// child: Text('Spiel starten'),
|
|
// ),
|
|
// Expanded(
|
|
// child: ListView.builder(
|
|
// itemCount: game.players.length,
|
|
// itemBuilder: (context, index) {
|
|
// return ListTile(
|
|
// title: Text(game.players[index].name),
|
|
// trailing: Icon(game.players[index].isRevealed
|
|
// ? Icons.visibility
|
|
// : Icons.visibility_off),
|
|
// onTap: () {
|
|
// setState(() {
|
|
// game.toggleReveal(index);
|
|
// });
|
|
// },
|
|
// subtitle: game.players[index].isRevealed
|
|
// ? Text(game.players[index].role as String)
|
|
// : null,
|
|
// );
|
|
// },
|
|
// ),
|
|
// ),
|
|
// ],
|
|
// ),
|
|
// );
|
|
// }
|
|
// }
|