import 'package:werwolf/models/role.dart'; import 'player.dart'; class Game { List players = []; List playernames = []; int numWolves = 1; Game({required this.playernames, required this.numWolves}) { assignRoles(); } void addPlayer(String name, Role role) { players.add(Player(name: name, role: role)); } List getPlayers() { return players; } void assignRoles() { List indexes = List.generate(playernames.length, (index) => index) ..shuffle(); for (var player in playernames) { //addPlayer(player, Role.dorfbewohner); for (int i = 0; i < numWolves; i++) { addPlayer(player[0], Role.dorfbewohner); } } } void incrementWolves() { if (numWolves < players.length) { numWolves++; } } void decrementWolves() { if (numWolves > 1) { numWolves--; } } // void toggleReveal(int index) { // players[index].isRevealed = !players[index].isRevealed; // } }