Пример #1
0
        public void RushToString()
        {
            var rush = new Rush();

            Assert.AreEqual(
                "Vida: 100, Ataque: 4, Defesa: 3",
                rush.ToString()
                );
        }
Пример #2
0
        public override string ToString()
        {
            var sb = new StringBuilder();

            sb.AppendLine("##############################################################################################################");
            sb.AppendLine("#                                            General Information                                             #");
            sb.AppendLine("##############################################################################################################");
            sb.AppendLine($"CurrentMap: {CurrentMap}");
            sb.AppendLine($"DefaultRoundTimeMultiplier: {DefaultRoundTimeMultiplier}");
            sb.AppendLine($"GameId: {GameId}");
            sb.AppendLine($"GameMode: {GameMode}");
            sb.AppendLine($"MapVariant: {MapVariant}");
            sb.AppendLine($"MaxPlayers: {MaxPlayers}");
            sb.AppendLine($"WaitingPlayers: {WaitingPlayers}");
            sb.AppendLine($"RoundTime: {RoundTime}");
            sb.AppendLine();

            if (Rush != null)
            {
                sb.AppendLine(Rush.ToString());
            }
            for (int i = 0; i < TeamInfo.Count; i++)
            {
                var team = TeamInfo[i.ToString()];
                sb.AppendLine("##############################################################################################################");
                sb.AppendLine($"#                                             Team {i} Information                                             #");
                sb.AppendLine("##############################################################################################################");

                sb.AppendLine($"| {"PersonaId",13} | {"Tag",4} | {"Name",30} | {"Rank",4} | {"Score",10} | {"Kills",5} | {"Deaths",6} | {"SquadId",7} | {"Role",4} |");
                sb.AppendLine($"|---------------|------|--------------------------------|------|------------|-------|--------|---------|------|");
                foreach (var player in team.Players)
                {
                    sb.AppendLine(player.Value.ToString());
                }
                sb.AppendLine($"|_______________|______|________________________________|______|____________|_______|________|_________|______|");
                sb.AppendLine();
            }

            Hashtable h = new Hashtable(new Dictionary <string, ulong?> {
                { "data", 291911755 }
            });

            return(sb.ToString());
        }