public Game GetGame() { var players = ShuffleSvc.Shuffle(Attendees, Rule); players = players.Select(p => { p.GameDescription = this.GameDescription; p.RoleDescription = RulesDescription.FirstOrDefault(rd => rd.Contains(p.Role.ToString())); return(p); }).ToList(); players = ShuffleService.Shuffle <Player>(players).ToList(); Player.ParentList = players; players.ForEach(p => p.NameNumMapList = string.Join("<br>", players.Select(q => { if (p.Role == Role.Judge) { return($"{players.IndexOf(q)}--{q.Attendee.Name}--{q.Role}"); } else { return($"{players.IndexOf(q)}--{q.Attendee.Name} {AddRoleIndecator(players.IndexOf(q))}"); } } ))); players.ForEach(q => { q.Company = players.Where(p => p.Role == q.Role && q.Role == Role.Wolf && p.Attendee.Name != q.Attendee.Name).ToList(); }); return(new Game(Round++, players)); }
public Game GetGame() { return(new Game(Round++, ShuffleSvc.Shuffle(Attendees, Rule))); }