Example #1
0
        public virtual string GetStatus(PvPTeam t)
        {
            if (t == null || t.Deleted)
            {
                return(String.Empty);
            }

            var lines = new StringBuilder();

            if (PointsTotal > 0)
            {
                lines.AppendLine("Points Total: {0:#,0} / {1:#,0}", t.GetTotalPoints(), PointsTotal);
            }

            if (PointsGained > 0)
            {
                lines.AppendLine("Points Gained: {0:#,0} / {1:#,0}", t.GetTotalPointsGained(), PointsGained);
            }

            if (PointsLost > 0)
            {
                lines.AppendLine("Points Lost: {0:#,0} / {1:#,0}", t.GetTotalPointsLost(), PointsLost);
            }

            if (Kills > 0)
            {
                lines.AppendLine("Kills: {0:#,0} / {1:#,0}", t.GetTotalKills(), Kills);
            }

            if (Deaths > 0)
            {
                lines.AppendLine("Deaths: {0:#,0} / {1:#,0}", t.GetTotalDeaths(), Deaths);
            }

            if (Resurrections > 0)
            {
                lines.AppendLine("Resurrections: {0:#,0} / {1:#,0}", t.GetTotalResurrections(), Resurrections);
            }

            if (DamageTaken > 0)
            {
                lines.AppendLine("Damage Taken: {0:#,0} / {1:#,0}", t.GetTotalDamageTaken(), DamageTaken);
            }

            if (DamageDone > 0)
            {
                lines.AppendLine("Damage Done: {0:#,0} / {1:#,0}", t.GetTotalDamageDone(), DamageDone);
            }

            if (HealingTaken > 0)
            {
                lines.AppendLine("Healing Taken: {0:#,0} / {1:#,0}", t.GetTotalHealingTaken(), HealingTaken);
            }

            if (HealingDone > 0)
            {
                lines.AppendLine("Healing Done: {0:#,0} / {1:#,0}", t.GetTotalHealingDone(), HealingDone);
            }

            return(lines.ToString());
        }
Example #2
0
        public virtual double ComputeScore(PvPTeam t, ref double min, ref double max, ref double total)
        {
            if (t == null || t.Deleted)
            {
                return(0);
            }

            double val, score = 0.0;

            if (PointsTotal > 0)
            {
                score += val = Math.Min(1.0, t.GetTotalPoints() / (double)PointsTotal);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            if (PointsGained > 0)
            {
                score += val = Math.Min(1.0, t.GetTotalPointsGained() / (double)PointsGained);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            if (PointsLost > 0)
            {
                score += val = Math.Min(1.0, t.GetTotalPointsLost() / (double)PointsLost);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            if (Kills > 0)
            {
                score += val = Math.Min(1.0, t.GetTotalKills() / (double)Kills);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            if (Deaths > 0)
            {
                score += val = Math.Min(1.0, t.GetTotalDeaths() / (double)Deaths);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            if (Resurrections > 0)
            {
                score += val = Math.Min(1.0, t.GetTotalResurrections() / (double)Resurrections);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            if (DamageTaken > 0)
            {
                score += val = Math.Min(1.0, t.GetTotalDamageTaken() / (double)DamageTaken);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            if (DamageDone > 0)
            {
                score += val = Math.Min(1.0, t.GetTotalDamageDone() / (double)DamageDone);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            if (HealingTaken > 0)
            {
                score += val = Math.Min(1.0, t.GetTotalHealingTaken() / (double)HealingTaken);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            if (HealingDone > 0)
            {
                score += val = Math.Min(1.0, t.GetTotalHealingDone() / (double)HealingDone);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            return(score);
        }