public void Status(Player player, Action action, Game game) { gameLog.Info("Sending Status of " + game + " to " + player.Address); Gmail.MessagePlayer(player, game, game.Status()); }
private void Vote(Player player, Action action, Game game) { Player nominee = action.Target; if (nominee == null) { if (action.Text.Equals("no one") || action.Text.Equals("nobody") || action.Text.Equals("noone")) { Player NoOne = new Player("No one", "nobody"); nominee = NoOne; } else { HandleBadAction(game, player, action, "You voted for an invalid player <b>" + action.Target + "</b> see the player's names below." + FlavorText.Divider + game.Status()); return; } } if (nominee.Equals(player)) { HandleBadAction(game, player, action, "You cannot vote for yourself."); } else if (!nominee.IsAlive) { HandleBadAction(game, player, action, nominee.Name.b() + " is already dead. See who's alive below:" + FlavorText.Divider + game.Status()); } else { Action vote = new Action(ActionEnum.Vote); vote.Target = nominee; player.AddAction(vote); Gmail.MessagePlayer(player, game, "Registered your vote for <b>" + nominee.Name + "</b>."); game.CheckEndOfCycle(); } }
public void Start(Player player, Action action, Game game) { if (game.IsOverlord(player)) { gameLog.Info("Attempting to start " + game); if (!game.Start()) { HandleBadAction(game, player, action, "You need at least 3 players to start a game." + FlavorText.Divider + game.Status()); } } }