private void DoDayVotes(Game game) { Player candidate = (Player)game.GetLivingPlayers().PickOne(); foreach (Player p in game.GetLivingPlayers()) { SendAction(game, p, candidate, "vote"); while (p.MyAction == null && game.IsInProgress && game.ActiveCycle == Game.Cycle.Day) { Player newCandidate = (Player)game.GetLivingPlayers().PickOne(); SendAction(game, p, newCandidate, "vote"); } } }
private void DoNightActions(Game game) { Player sheepleCandidate = (Player)LivingSheeple(game).PickOne(); foreach (Player p in game.GetLivingPlayers()) { Player candidate = (Player)game.GetLivingPlayers().PickOne(); if (p.Team.Equals("Illuminati")) SendAction(game, p, sheepleCandidate, p.Role.ActionText); else SendAction(game, p, candidate, p.Role.ActionText); while (p.MyAction == null && game.IsInProgress && game.ActiveCycle == Game.Cycle.Night) { if (p.Team.Equals("Illuminati")) { sheepleCandidate = (Player)LivingSheeple(game).PickOne(); SendAction(game, p, sheepleCandidate, p.Role.ActionText); } else { candidate = (Player)game.GetLivingPlayers().PickOne(); SendAction(game, p, candidate, p.Role.ActionText); } } } }
private List<Player> LivingSheeple(Game game) { List<Player> sheeple = new List<Player>(); foreach (Player p in game.GetLivingPlayers()) { if (!p.Team.Equals("Illuminati")) sheeple.Add(p); } return sheeple; }