protected static void AssertBuildingAdded(Match game)
 {
     var ship = game.GetPlayer(1).Ship;
     Assert.IsNotNull(game.Map.GetEntity(ship.X, ship.Y + 1), "Building was not added.");
     Assert.IsNotNull(game.Map.GetEntity(ship.X + 1, ship.Y + 1), "Building was not added.");
     Assert.IsNotNull(game.Map.GetEntity(ship.X + 2, ship.Y + 1), "Building was not added.");
 }
 public override object GetValue(Match match)
 {
     return match.GetPlayer(1).MissileLimit;
 }
 public override object GetValue(Match match)
 {
     return match.GetPlayer(1).AlienWaveSize;
 }
 protected static Dictionary<string, object> RenderPlayer(Match match, int playerNumber)
 {
     var player = match.GetPlayer(playerNumber);
     var result = new Dictionary<string, object>
     {
         {"Number", playerNumber},
         {"Name", player.PlayerName},
         {"Kills", player.Kills}
     };
     return result;
 }
 protected void RenderPlayerDetailsAdvanced(Match match, int playerNumber, StringBuilder output)
 {
     var player = match.GetPlayer(playerNumber);
     var width = match.Map.Width;
     var lines = new List<string>();
     AddBorderAndPlayerNameToLines(player, width, lines);
     AddPlayerAdvancedDetailsToLines(player, width, lines);
     AddPlayerDetailsToLines(player, match, lines);
     AddPlayerLinesToOutput(player, lines, output);
 }
        protected static void RenderWinDetails(MatchSummary result, Match match)
        {
            if (match.GetResult() == MatchResult.Tie)
            {
                result.Winner = 1;
                result.WinReason = "Match was a tie, so player 1 wins by default.";
                return;
            }

            var winner = match.GetResult() == MatchResult.PlayerOneWins ? match.GetPlayer(1) : match.GetPlayer(2);
            var opponent = match.GetResult() == MatchResult.PlayerOneWins ? match.GetPlayer(2) : match.GetPlayer(1);

            result.Winner = winner.PlayerNumber;

            if (((opponent.Lives <= 0) && (opponent.Ship == null)) &&
                ((winner.Lives > 0) || (winner.Ship != null)))
            {
                result.WinReason = String.Format("Player {0} ran out of lives.", opponent.PlayerNumber);
            }
            else
            {
                result.WinReason = String.Format("Player {0} had more kills than player {1}.", winner.PlayerNumber,
                    opponent.PlayerNumber);
            }
        }