Example #1
0
 public void lstDialog(string Gamefolder)
 {
     string[] files = Directory.GetFiles(Gamefolder);
     foreach (string file in files)
     {
         if (Path.GetExtension(file) == ".timmeta")
         {
             try
             {
                 MetaAndTXTObjects MetaInfo = JsonConvert.DeserializeObject <MetaAndTXTObjects>(File.ReadAllText(file));
                 lstGames.Items.Add(MetaInfo);
             }
             catch
             {
                 lstGames.Items.Add("Invaild File, tampered or corrupted");
                 continue;
             }
         }
         else if (Path.GetExtension(file) == ".txt")
         {
             try
             {
                 MetaAndTXTObjects TxtInfo = JsonConvert.DeserializeObject <MetaAndTXTObjects>(File.ReadAllText(file));
                 lstGames.Items.Add(TxtInfo);
             }
             catch
             {
                 lstGames.Items.Add("Invaild File, tampered or corrupted");
                 continue;
             }
         }
     }
 }
Example #2
0
        public void SpecialRoundLog(Rounders rounders, MetaAndTXTObjects Game1, MetaAndTXTObjects Game2)
        {
            GCLog(Utilities.SpecialRoundType(Game1.LevelName));
            if (Game1.CurrentRound.Number > Game2.CurrentRound.Number)
            {
                GCLog($"Round: {Game1.CurrentRound.Number} Game up until Round: {Game2.CurrentRound.Number}");
                GCLog(string.Join(", ", rounders.game1specialrounds));
            }
            else
            {
                GCLog($"Round: {Game1.CurrentRound.Number} Game");
                GCLog(string.Join(", ", rounders.game1specialrounds));
            }


            if (Game2.CurrentRound.Number > Game1.CurrentRound.Number)
            {
                GCLog($"Round: {Game2.CurrentRound.Number} Game up until Round: {Game1.CurrentRound.Number}");
                GCLog(string.Join(", ", rounders.game2specialrounds));
            }
            else
            {
                GCLog($"Round: {Game2.CurrentRound.Number} Game");
                GCLog(string.Join(", ", rounders.game1specialrounds));
            };
            GCLog($"Four Rounders: {rounders.G1FourRounders} | {rounders.G2FourRounders}");
            GCLog($"Five Rounders: {rounders.G1FiveRounders} | {rounders.G2FiveRounders}");
        }
Example #3
0
 public void TimeTo(MetaAndTXTObjects Info)
 {
     foreach (Round currentround in Info.Rounds)
     {
         if (currentround.Number % 10 == 0 && currentround.Number >= 50 || currentround.Number == 30)
         {
             TimesLog($" {currentround.Number} - {Utilities.FormatTime(currentround.StartTimestamp, Info.StartTimestamp)}");
         }
     }
     TimesLog(" ");
 }
Example #4
0
        public void SetupInfo(MetaAndTXTObjects Info)
        {
            long SetUpRound = Utilities.GetSetUpRound(Info);

            if (SetUpRound != 0)
            {
                GameInfoLog("Setup Info:");
                GameInfoLog("Round: " + SetUpRound);
                GameInfoLog("");
            }
        }
Example #5
0
 public void GameEndLog(MetaAndTXTObjects Info)
 {
     if (Info.EndTimestamp > Info.StartTimestamp)
     {
         RoundInfoLog("Game ended on round: " + Info.CurrentRound.Number + " at " + Utilities.FormatTime(Info.EndTimestamp, Info.StartTimestamp));
     }
     else
     {
         RoundInfoLog("Bennie is bad at coding so the End Time Stamp was not logged");
     }
 }
Example #6
0
 public static long GetSetUpRound(MetaAndTXTObjects info)
 {
     foreach (Round currentround in info.Rounds)
     {
         if (info.SetUpTimestamp < currentround.StartTimestamp)
         {
             return(currentround.Number - 1);
         }
     }
     return(0);
 }
Example #7
0
        public void TimetoΔ(MetaAndTXTObjects Game1, MetaAndTXTObjects Game2)
        {
            //game1 data collection

            int            minrounds   = Math.Min(Game1.Rounds.Count(), Game2.Rounds.Count());
            List <decimal> g1splits    = new List <decimal>();
            List <long>    SplitRounds = new List <long>();

            for (int i = 0; i < minrounds; i++)
            {
                if (Game1.Rounds[i].Number % 10 == 0 && Game1.Rounds[i].Number >= 50 || Game1.Rounds[i].Number == 30)
                {
                    SplitRounds.Add(Game1.Rounds[i].Number);
                    g1splits.Add(Utilities.Time(Game1.Rounds[i].StartTimestamp, Game1.StartTimestamp));
                }
            }
            //game2 data collection
            List <decimal> g2splits = new List <decimal>();

            for (int i = 0; i < minrounds; i++)
            {
                if (Game2.Rounds[i].Number % 10 == 0 && Game1.Rounds[i].Number >= 50 || Game1.Rounds[i].Number == 30)
                {
                    g2splits.Add(Utilities.Time(Game2.Rounds[i].StartTimestamp, Game2.StartTimestamp));
                }
            }
            decimal                TimeinHrs;
            decimal                TimeinMins;
            decimal                TimeinSecs;
            List <decimal>         TimetoΔ   = new List <decimal>();
            List <TimeToDeltaInfo> DeltaList = new List <TimeToDeltaInfo>();

            for (int i = 0; i < g1splits.Count(); i++)
            {
                TimetoΔ.Add(g1splits[i] - g2splits[i]);
                if (Math.Abs(TimetoΔ[i]) >= 3600000)
                {
                    TimeinHrs = (TimetoΔ[i]) / (decimal)3600000;
                    GCLog($"{SplitRounds[i]} : {Math.Round(TimeinHrs,2)} Hours");
                }
                else if (Math.Abs(TimetoΔ[i]) >= 60000)
                {
                    TimeinMins = (TimetoΔ[i]) / (decimal)60000;
                    GCLog($"{SplitRounds[i]} : {Math.Round(TimeinMins, 2)} Minutes");
                }
                else if (Math.Abs(TimetoΔ[i]) >= 1000)
                {
                    TimeinSecs = (TimetoΔ[i]) / (decimal)1000;
                    GCLog($"{SplitRounds[i]} : {Math.Round(TimeinSecs, 2)} Seconds");
                }
            }
        }
Example #8
0
        //parent functions
        public void gamelabel(MetaAndTXTObjects Info)
        {
            if (Info.PlayerCount == 1)
            {
                string MapName = Utilities.MapNameConv(Info.LevelName);


                GameLabelLog(MapName + " | Solo | ");
                GameLabelRoundLog(" Round: " + Info.CurrentRound.Number);
            }
            else if (Info.PlayerCount > 1)
            {
                string MapName = Utilities.MapNameConv(Info.LevelName);
                GameLabelLog(MapName + " | " + Info.PlayerCount + " Player | ");
                GameLabelRoundLog(" Round: " + Info.CurrentRound.Number);

                GameLabelLog(" ");
            }
        }
Example #9
0
        public void SpecialRounds(MetaAndTXTObjects Info)
        {
            List <string> specialrounds    = new List <string>();
            string        SpecialRoundName = Utilities.SpecialRoundType(Info.LevelName);

            if (SpecialRoundName != "no special rounds")
            {
                int Fourrounders = 0, Fiverounders = 0, lastfound = 0;

                foreach (Round round in Info.Rounds)
                {
                    if (round.IsSpecialRound == true)
                    {
                        if (lastfound != 0)
                        {
                            if ((round.Number - lastfound) % 4 == 0)
                            {
                                Fourrounders += 1;
                            }
                            else if ((round.Number - lastfound) % 5 == 0)
                            {
                                Fiverounders += 1;
                            }
                            else
                            {
                                GameInfoLog($"Not A Vaild Rounder... MODDING or Bennie sucks at coding !?! ");
                            }
                        }

                        specialrounds.Add(round.Number.ToString());
                        lastfound = (int)round.Number;
                    }
                }

                GameInfoLog(SpecialRoundName + " " + string.Join(", ", specialrounds));
                GameInfoLog($"Four rounders: {Fourrounders}");
                GameInfoLog($"Five rounders: {Fiverounders}");
            }
        }
Example #10
0
 public void PlayerInfo(MetaAndTXTObjects Info)
 {
     foreach (Player currentplayer in Info.Players)
     {
         List <string> Downedrounds   = new List <string>();
         long          lastfoundDowns = 0;
         GameInfoLog(currentplayer.Name);
         GameInfoLog($"Downs: {currentplayer.Downs}");
         foreach (Round currentround in Info.Rounds)
         {
             try
             {
                 PlayerStat player = currentround.PlayerStats.AsEnumerable().SingleOrDefault((p) => p.Slot == currentplayer.Slot);
                 if (player.Downs == lastfoundDowns + 1)
                 {
                     Downedrounds.Add(currentround.Number.ToString());
                     lastfoundDowns = player.Downs;
                 }
                 else if ((player.Downs - lastfoundDowns) > 1)
                 {
                     Downedrounds.Add($" {currentround.Number} ({player.Downs - lastfoundDowns})");
                     lastfoundDowns = player.Downs;
                 }
                 else if (lastfoundDowns == player.Downs)
                 {
                     lastfoundDowns = player.Downs;
                 }
             }
             catch
             {
                 continue;
             }
         }
         GameInfoLog(string.Join(",", Downedrounds));
     }
 }
Example #11
0
        public void TimSaved(MetaAndTXTObjects TxtInfo)
        {
            // Map Name
            gamelabel(TxtInfo);

            //game info
            GameInfoLog(" ");
            GameInfoLog("Game Stats:");
            GameInfoLog($"solo lives used: {TxtInfo.SoloLivesGiven}");
            ///Set up Infomation

            SetupInfo(TxtInfo);
            // special rounds stuff
            SpecialRounds(TxtInfo);
            GameInfoLog($"BoxHits: {TxtInfo.BoxHits}");
            GameInfoLog("");
            if (TxtInfo.CurrentRound.Number >= 163)
            {
                GameInfoLog("Pro developer bennie missed a bug in TIM that make missed insta kill rounds not viewable with lifespan of the TXT filetype.");
            }

            //trades
            List <long> Tradetimes = new List <long>();
            List <long> Boxhits    = new List <long>();

            foreach (Trade Tradeinfo in TxtInfo.Trades)
            {
                Tradetimes.Add(Tradeinfo.Time);

                Boxhits.Add(Tradeinfo.BoxHits);
            }

            if (Tradetimes.Count != 0)
            {
                if (Tradetimes.Count() != 0 && Boxhits.Count() != 0)
                {
                    TradeLog($"Trade count: {Tradetimes.Count}");
                    TradeLog($"Trade Average: {Math.Round((Tradetimes.Average() / 60000), 2)}");
                    TradeLog($"Box Hit Average: {Math.Round(Boxhits.Average(), 2)}");
                    TradeLog(" ");
                }
                int tradenumber = 0;
                foreach (Trade trade in TxtInfo.Trades)
                {
                    tradenumber += 1;
                    TradeLog($"Trade: {tradenumber}");
                    if (trade.StartRoundNumber != trade.EndRoundNumber)
                    {
                        TradeLog($"Rounds: {trade.StartRoundNumber} - {trade.EndRoundNumber}");
                    }
                    else
                    {
                        TradeLog($"Round: {trade.StartRoundNumber}");
                    }

                    TradeLog($"Trade Length: {Utilities.FormatTime(trade.EndTimestamp, trade.StartTimestamp)}");
                    TradeLog($"Boxhits: {trade.BoxHits}");
                    TradeLog(" ");
                }
                if (TxtInfo.CurrentTrade != null)
                {
                    TradeLog($"Current Trade:");
                    TradeLog($"{TxtInfo.CurrentTrade.StartRoundNumber}- {TxtInfo.CurrentRound.Number}");

                    decimal Time = TxtInfo.CurrentTrade.StartTimestamp / (decimal)60000;

                    if (Time > 60)
                    {
                        Time /= 60;
                        int     hours     = (int)Math.Truncate(Time);
                        decimal mins      = (Time - hours) * 60;
                        int     minswhole = (int)Math.Truncate(mins);
                        decimal secs      = (mins - minswhole) * 60;
                        int     secswhole = (int)Math.Truncate(secs);
                        decimal milsecs   = (secs - secswhole);
                        milsecs = Math.Round(milsecs, 0);
                        TradeLog($"Trade Started at: {hours + ":" + minswhole.ToString("D2") + ":" + secswhole.ToString("D2") + "." + milsecs}");
                    }

                    else
                    {
                        decimal mins      = Time;
                        int     minswhole = (int)Math.Truncate(mins);
                        decimal secs      = (mins - minswhole) * 60;
                        int     secswhole = (int)Math.Truncate(secs);
                        decimal milsecs   = (secs - secswhole);
                        milsecs = Math.Round(milsecs, 0);
                        TradeLog($"Trade Started at: {minswhole.ToString("D2") + ":" + secswhole.ToString("D2") + "." + milsecs}");
                    }

                    TradeLog($"Boxhits: {TxtInfo.CurrentTrade.BoxHits}");
                }
            }
            else
            {
                TradeLog("No trades logged");
            }

            //time to
            TimeTo(TxtInfo);

            //Individual round info
            IRS(TxtInfo);
        }
Example #12
0
        public void TimMeta(MetaAndTXTObjects MetaInfo)
        {
            // game label
            gamelabel(MetaInfo);

            if ((MetaInfo.PlayerCount == 1))
            {
                PlayerInfo(MetaInfo);
            }
            else if (MetaInfo.PlayerCount > 1)
            {
                GameInfoLog(" ");
                GameInfoLog("Players and Player Stats:");

                PlayerInfo(MetaInfo);
            }
            GameInfoLog(" ");
            GameInfoLog("Game Stats:");

            //GameInfoLog(" ");
            //GameInfoLog("Game Stats:");
            /// special rounds stuff
            SpecialRounds(MetaInfo);

            GameInfoLog($"BoxHits: {MetaInfo.BoxHits}");
            GameInfoLog("");
            ///Set up Infomation

            SetupInfo(MetaInfo);

            ///missed instas log
            if (MetaInfo.CurrentRound.Number >= 163)
            {
                List <string> MissedInstas = new List <string>();
                foreach (Round currentround in MetaInfo.Rounds)
                {
                    if (currentround.MissedInsta == true)
                    {
                        MissedInstas.Add(currentround.Number.ToString());
                    }
                }
                if (MissedInstas.Count != 0)
                {
                    GameInfoLog($"Missed Instas:{MissedInstas.Count} ({string.Join(",", MissedInstas)}) ");
                    GameInfoLog(" ");
                }
            }

            List <long> Tradetimes = new List <long>();
            List <long> Boxhits    = new List <long>();
            List <long> Traphits   = new List <long>();

            foreach (Trade Tradeinfo in MetaInfo.Trades)
            {
                Tradetimes.Add(Tradeinfo.Time);
                Traphits.Add(Tradeinfo.TrapHits);
                Boxhits.Add(Tradeinfo.BoxHits);
            }

            if (Tradetimes.Count != 0)
            {
                if (Tradetimes.Count != 0 && Boxhits.Count != 0)
                {
                    TradeLog($"Trade count: {Tradetimes.Count}");
                    TradeLog($"Trade Average: {Math.Round((Tradetimes.Average() / 60000), 2)}");
                    TradeLog($"Box Hit Average: {Math.Round(Boxhits.Average(), 2)}");
                    TradeLog($"Trap Hit Average: {Math.Round(Traphits.Average(), 2)}");
                    if (Math.Round(Traphits.Average(), 2) != 0)
                    {
                        TradeLog($"Boxhits per traps: {Math.Round((Math.Round(Boxhits.Average(), 2) / Math.Round(Traphits.Average(), 2)), 2)}");
                    }
                    TradeLog(" ");
                }
                int tradenumber = 0;
                foreach (Trade trade in MetaInfo.Trades)
                {
                    tradenumber += 1;
                    TradeLog($"Trade: {tradenumber}");
                    if (trade.StartRoundNumber != trade.EndRoundNumber)
                    {
                        TradeLog($"Rounds: {trade.StartRoundNumber} - {trade.EndRoundNumber}");
                    }
                    else
                    {
                        TradeLog($"Round: {trade.StartRoundNumber}");
                    }
                    TradeLog($"Trade Length: {Utilities.FormatTime(trade.EndTimestamp, trade.StartTimestamp)}");
                    TradeLog($"Boxhits: {trade.BoxHits}");
                    TradeLog($"Traphits: {trade.TrapHits}");
                    TradeLog(" ");
                }
                if (MetaInfo.CurrentTrade != null)
                {
                    TradeLog($"Current Trade:");
                    TradeLog($"{MetaInfo.CurrentTrade.StartRoundNumber}- {MetaInfo.CurrentRound.Number}");

                    decimal Time = MetaInfo.CurrentTrade.StartTimestamp / (decimal)60000;

                    if (Time > 60)
                    {
                        Time /= 60;
                        int     hours     = (int)Math.Truncate(Time);
                        decimal mins      = (Time - hours) * 60;
                        int     minswhole = (int)Math.Truncate(mins);
                        decimal secs      = (mins - minswhole) * 60;
                        int     secswhole = (int)Math.Truncate(secs);
                        decimal milsecs   = (secs - secswhole);
                        milsecs = Math.Round(milsecs, 0);
                        TradeLog($"Trade Started at: {hours + ":" + minswhole.ToString("D2") + ":" + secswhole.ToString("D2") + "." + milsecs}");
                    }
                    else
                    {
                        decimal mins      = Time;
                        int     minswhole = (int)Math.Truncate(mins);
                        decimal secs      = (mins - minswhole) * 60;
                        int     secswhole = (int)Math.Truncate(secs);
                        decimal milsecs   = (secs - secswhole);
                        milsecs = Math.Round(milsecs, 0);
                        TradeLog($"Trade Started at: {minswhole.ToString("D2") + ":" + secswhole.ToString("D2") + "." + milsecs}");
                    }

                    TradeLog($"Boxhits: {MetaInfo.CurrentTrade.BoxHits}");
                    TradeLog($"Traphits: {MetaInfo.CurrentTrade.TrapHits}");
                }
            }
            else
            {
                TradeLog("No trades logged");
            }

            //time to functions
            TimeTo(MetaInfo);

            //Indualvidual Round Stats
            IRS(MetaInfo);
        }
Example #13
0
        public void IRS(MetaAndTXTObjects Info)
        {
            foreach (Round currentround in Info.Rounds)
            {
                //call to zombie count function and convert to hordes
                double  Zombies   = Utilities.CalculateZombieCount((uint)Info.PlayerCount, currentround.Number);
                decimal Hordes    = (decimal)(Zombies / 24);
                decimal sph       = 0;
                decimal roundtime = Utilities.Time(currentround.EndTimestamp, currentround.StartTimestamp);
                roundtime /= 60000;

                //calculate sph
                if (currentround.IsSpecialRound == false)
                {
                    sph  = roundtime / Hordes;
                    sph *= 60;
                    sph  = Math.Round(sph, 2);
                }

                // special round true
                if (roundtime > 1 && currentround.IsSpecialRound)
                {
                    roundtime = Math.Round(roundtime, 2);
                    RoundInfoLog("round: " + currentround.Number + " in " + roundtime + "Min's" + " " + (currentround.IsSpecialRound ? "special round" : ""));
                }
                else if (roundtime < 1 && currentround.IsSpecialRound)
                {
                    roundtime *= 60;
                    roundtime  = Math.Round(roundtime, 2);
                    RoundInfoLog("round: " + currentround.Number + " in " + roundtime + "sec's" + " " + (currentround.IsSpecialRound ? "special round" : ""));
                }

                //round time Log < 1 min
                if (roundtime < 1 && !currentround.IsSpecialRound && currentround.TrapHits > 0)
                {
                    roundtime *= 60;
                    roundtime  = Math.Round(roundtime, 2);
                    RoundInfoLog("round: " + currentround.Number + " in " + roundtime + " Sec's" + " " + "| Round sph: " + sph + "|" + " Trap hits:" + currentround.TrapHits + "|");
                }
                else if (roundtime < 1 && !currentround.IsSpecialRound && currentround.TrapHits == 0)
                {
                    roundtime *= 60;
                    roundtime  = Math.Round(roundtime, 2);
                    RoundInfoLog("round: " + currentround.Number + " in " + roundtime + " Sec's" + " " + "| Round sph: " + sph + "|");
                }

                //round time Log > 1 min
                else if (roundtime > 1 && !currentround.IsSpecialRound && currentround.TrapHits > 0)
                {
                    roundtime = Math.Round(roundtime, 2);
                    RoundInfoLog("round: " + currentround.Number + " in " + roundtime + " Min's" + " " + "| Round sph: " + sph + "|" + " Trap hits:" + currentround.TrapHits + "|");
                }

                else if (roundtime > 1 && !currentround.IsSpecialRound && currentround.TrapHits == 0)
                {
                    roundtime = Math.Round(roundtime, 2);
                    RoundInfoLog("round: " + currentround.Number + " in " + roundtime + " Min's" + " " + "| Round sph: " + sph + "|");
                }
            }

            RoundInfoLog("Round: " + Info.CurrentRound.Number.ToString() + " Started at " + Utilities.FormatTime(Info.CurrentRound.StartTimestamp, Info.StartTimestamp));
            GameEndLog(Info);
        }
Example #14
0
        //functions
        public Rounders Specialroundcollection(MetaAndTXTObjects Game1, MetaAndTXTObjects Game2)
        {
            Rounders rounders = new Rounders();

            int lastfoundg1          = 0;
            int lastfoundg2          = 0;
            int InvaildGame1rounders = 0;
            int InvaildGame2rounders = 0;

            foreach (Round roundg1 in Game1.Rounds)
            {
                if (roundg1.IsSpecialRound == true)
                {
                    if (lastfoundg1 != 0)
                    {
                        if ((roundg1.Number - lastfoundg1) % 4 == 0)
                        {
                            rounders.G1FourRounders += 1;
                        }
                        else if ((roundg1.Number - lastfoundg1) % 5 == 0)
                        {
                            rounders.G1FiveRounders += 1;
                        }
                        else
                        {
                            InvaildGame1rounders += 1;
                        }
                    }

                    rounders.game1specialrounds.Add(roundg1.Number.ToString());
                    lastfoundg1 = (int)roundg1.Number;
                }
                if (roundg1.Number == Game2.CurrentRound.Number)
                {
                    break;
                }
            }
            foreach (Round roundg2 in Game2.Rounds)
            {
                if (roundg2.IsSpecialRound == true)
                {
                    if (lastfoundg2 != 0)
                    {
                        if ((roundg2.Number - lastfoundg2) % 4 == 0)
                        {
                            rounders.G2FourRounders += 1;
                        }
                        else if ((roundg2.Number - lastfoundg2) % 5 == 0)
                        {
                            rounders.G2FiveRounders += 1;
                        }
                        else
                        {
                            InvaildGame2rounders += 1;
                        }
                    }

                    rounders.game2specialrounds.Add(roundg2.Number.ToString());
                    lastfoundg2 = (int)roundg2.Number;
                }
                if (roundg2.Number == Game1.CurrentRound.Number)
                {
                    break;
                }
            }
            if (InvaildGame1rounders != 0)
            {
                Utilities.ShowMessageBox($" The {Game1.CurrentRound.Number.ToString()} game has invaild rounders");
            }
            if (InvaildGame2rounders != 0)
            {
                Utilities.ShowMessageBox($" The {Game2.CurrentRound.Number.ToString()} game has invaild rounders");
            }
            return(rounders);
        }
Example #15
0
        public void TimComparison(MetaAndTXTObjects Game1, MetaAndTXTObjects Game2)
        {
            //Checks
            if (Game1 == null && Game2 == null)
            {
                Utilities.ShowMessageBox("Game/Games are not vaild");
                return;
            }

            if (Game1.PlayerCount != Game2.PlayerCount || Game1.LevelName != Game2.LevelName)
            {
                Utilities.ShowMessageBox("Game comparisons can only be done with games of the same map and same player count");
                return;
            }

            //Gamelabel
            string Game1MapName = Utilities.MapNameConv(Game1.LevelName);
            string Game2MapName = Utilities.MapNameConv(Game2.LevelName);

            if (Game1.PlayerCount == 1)
            {
                GCLabel($"{Game1MapName} | Round: {Game1.CurrentRound.Number} vs. Round: {Game2.CurrentRound.Number} | Solo ");
            }
            else
            {
                GCLabel($"{Game1MapName} | Round: {Game1.CurrentRound.Number} vs. Round: {Game2.CurrentRound.Number} | {Game1.PlayerCount} Player ");
            }

            if (Game1.Fh != null && Game2.Fh != null)
            {
                // header
                GCLog($" Round: {Game1.CurrentRound.Number} | Round: {Game2.CurrentRound.Number}");
                GCLog("");
                //special round  stuff
                if (Utilities.SpecialRoundType(Game1.LevelName) != "no special rounds")
                {
                    Rounders rounders = Specialroundcollection(Game1, Game2);
                    SpecialRoundLog(rounders, Game1, Game2);
                }
                //Indualvidual round comparison
                IRCLog($" (Round: {Game1.CurrentRound.Number} stats)  - (Round: {Game2.CurrentRound.Number} stats)");
                IDC(Game1, Game2);
                TimetoΔ(Game1, Game2);
            }
            else
            {
                // header
                GCLog($" Round: {Game1.CurrentRound.Number} | Round: {Game2.CurrentRound.Number}");
                GCLog("");
                //special round  stuff
                if (Utilities.SpecialRoundType(Game1.LevelName) != "no special rounds")
                {
                    Rounders rounders = Specialroundcollection(Game1, Game2);
                    SpecialRoundLog(rounders, Game1, Game2);
                }
                IRCLog($" (Round: {Game1.CurrentRound.Number} stats)  - (Round: {Game2.CurrentRound.Number} stats)");
                IDC(Game1, Game2);
                TimetoΔ(Game1, Game2);
            }


            this.Show();
        }
Example #16
0
        public void IDC(MetaAndTXTObjects Game1, MetaAndTXTObjects Game2)
        {
            //game1 sph and roundtime list grabing
            List <decimal> sphg1            = new List <decimal>();
            List <decimal> roundtimeinming1 = new List <decimal>();


            foreach (Round currentround in Game1.Rounds)
            {
                //call to zombie count function and convert to hordes

                double Zombies = Utilities.CalculateZombieCount((uint)Game1.PlayerCount, currentround.Number);

                decimal Hordes = (decimal)(Zombies / 24);


                decimal sph;
                decimal roundtime = Utilities.Time(currentround.EndTimestamp, currentround.StartTimestamp);
                roundtime /= 60000;

                //calculate sph

                sph  = roundtime / Hordes;
                sph *= 60;
                sph  = Math.Round(sph, 2);
                sphg1.Add(sph);
                roundtimeinming1.Add(roundtime);

                if (currentround.Number == Game2.CurrentRound.Number)
                {
                    break;
                }
            }
            //game2 sph and roundtime list grabing
            List <decimal> sphg2            = new List <decimal>();
            List <decimal> roundtimeinming2 = new List <decimal>();

            foreach (Round currentround in Game2.Rounds)
            {
                //call to zombie count function and convert to hordes

                double Zombies = Utilities.CalculateZombieCount((uint)Game2.PlayerCount, currentround.Number);

                decimal Hordes = (decimal)(Zombies / 24);


                decimal sph;
                decimal roundtime = Utilities.Time(currentround.EndTimestamp, currentround.StartTimestamp);
                roundtime /= 60000;

                //calculate sph

                sph  = roundtime / Hordes;
                sph *= 60;
                sph  = Math.Round(sph, 2);
                sphg2.Add(sph);
                roundtimeinming2.Add(roundtime);

                if (currentround.Number == Game1.CurrentRound.Number)
                {
                    break;
                }
            }


            if (Game1.CurrentRound.Number > Game2.CurrentRound.Number)
            {
                int minrounds = Math.Min(Game1.Rounds.Count(), Game2.Rounds.Count());
                for (int i = 0; i < minrounds; i++)
                {
                    if (!Game1.Rounds[i].IsSpecialRound && !Game2.Rounds[i].IsSpecialRound)
                    {
                        decimal sphdelta       = Math.Round(sphg1[(int)(Game1.Rounds[i].Number - 1)] - sphg2[(int)(Game1.Rounds[i].Number - 1)], 2);
                        decimal roundtimedelta = Math.Round(roundtimeinming1[(int)(Game1.Rounds[i].Number - 1)] - roundtimeinming2[(int)(Game1.Rounds[i].Number - 1)], 2);
                        if (Math.Abs(roundtimedelta) >= 1)
                        {
                            IRCLog($"Round: {Game1.Rounds[i].Number} | SphΔ: {sphdelta} | TimeΔ: {roundtimedelta} (Min's) ");
                        }
                        else if (Math.Abs(roundtimedelta) < 1)
                        {
                            roundtimedelta *= 60;
                            IRCLog($"Round: {Game1.Rounds[i].Number} | SphΔ: {sphdelta} | TimeΔ: {roundtimedelta} (sec's) ");
                        }
                    }
                    else
                    {
                        decimal roundtimedelta = Math.Round(roundtimeinming1[(int)(Game1.Rounds[i].Number - 1)] - roundtimeinming2[(int)(Game1.Rounds[i].Number - 1)], 2);
                        if (Math.Abs(roundtimedelta) >= 1)
                        {
                            IRCLog($"Round: {Game1.Rounds[i].Number} | TimeΔ: {roundtimedelta} (Min's) ");
                        }
                        else if (Math.Abs(roundtimedelta) < 1)
                        {
                            roundtimedelta *= 60;
                            IRCLog($"Round: {Game1.Rounds[i].Number} | TimeΔ: {roundtimedelta} (sec's) ");
                        }
                    }
                }
            }
            else if (Game2.CurrentRound.Number > Game1.CurrentRound.Number || Game2.CurrentRound.Number == Game1.CurrentRound.Number)
            {
                int minrounds = Math.Min(Game1.Rounds.Count(), Game2.Rounds.Count());
                for (int i = 0; i < minrounds; i++)
                {
                    if (!Game1.Rounds[i].IsSpecialRound && !Game2.Rounds[i].IsSpecialRound)
                    {
                        decimal sphdelta       = Math.Round(sphg2[(int)(Game1.Rounds[i].Number - 1)] - sphg1[(int)(Game1.Rounds[i].Number - 1)], 2);
                        decimal roundtimedelta = Math.Round(roundtimeinming2[(int)(Game1.Rounds[i].Number - 1)] - roundtimeinming1[(int)(Game1.Rounds[i].Number - 1)], 2);
                        if (Math.Abs(roundtimedelta) >= 1)
                        {
                            IRCLog($"Round: {Game1.Rounds[i].Number} | TimeΔ: {roundtimedelta} (Min's) | SphΔ: {sphdelta} ");
                        }
                        else if (Math.Abs(roundtimedelta) < 1)
                        {
                            roundtimedelta *= 60;
                            IRCLog($"Round: {Game1.Rounds[i].Number} | TimeΔ: {roundtimedelta} (sec's) | SphΔ: {sphdelta} ");
                        }
                    }
                    else
                    {
                        decimal roundtimedelta = Math.Round(roundtimeinming2[(int)(Game1.Rounds[i].Number - 1)] - roundtimeinming1[(int)(Game1.Rounds[i].Number - 1)], 2);
                        if (Math.Abs(roundtimedelta) >= 1)
                        {
                            IRCLog($"Round: {Game1.Rounds[i].Number} | TimeΔ: {roundtimedelta} (Min's) ");
                        }
                        else if (Math.Abs(roundtimedelta) < 1)
                        {
                            roundtimedelta *= 60;
                            IRCLog($"Round: {Game1.Rounds[i].Number} | TimeΔ: {roundtimedelta} (sec's) ");
                        }
                    }
                }
            }
        }