cpd_David_und_Yusuf/lib/models/games.dart

36 lines
676 B
Dart

import 'package:werwolf/models/role.dart';
import 'player.dart';
class Game {
List<Player> players = [];
List playernames = [];
int numWolves = 1;
Map specialRoles = <Role, bool>{};
Game({required this.playernames}) {
for (Role role in Role.values) {
if (role != Role.dorfbewohner && role != Role.werwolf) {
specialRoles[role] = false;
}
}
}
void incrementWolves() {
if (numWolves < playernames.length - 1 &&
(playernames.length) >= ((numWolves + 1) * 3)) {
numWolves++;
}
}
void decrementWolves() {
if (numWolves > 1) {
numWolves--;
}
}
int getWolves() {
return numWolves;
}
}