Ejemplo n.º 1
0
        /// <summary>
        /// Compares skaters based on total points. If total points are equal, then "basic skating" defines order, if that is same too, then "presentation" defines order
        /// </summary>
        /// <param name="skaterY"></param>
        /// <param name="skaterX"></param>
        /// <returns></returns>
        private int SkaterPointCompare(Skater skaterX, Skater skaterY)
        {
            if (skaterY.TotalPoints == 0 && skaterX.TotalPoints == 0)
            {
                return(0);
            }

            if (skaterY.TotalPoints == skaterX.TotalPoints)
            {
                if (skaterY.AveragePointsPerArea[0] == skaterX.AveragePointsPerArea[0])
                {
                    int presentationSlot = 4;

                    if (ddlTulospohja.SelectedItem.ToString().ToLower().Contains("laaja"))
                    {
                        presentationSlot = 6;
                    }
                    // Presentation
                    return(decimal.Compare(skaterY.AveragePointsPerArea[presentationSlot], skaterX.AveragePointsPerArea[presentationSlot]));
                }
                else
                {
                    // Basic skating
                    return(decimal.Compare(skaterY.AveragePointsPerArea[0], skaterX.AveragePointsPerArea[0]));
                }
            }
            else
            {
                return(decimal.Compare(skaterY.TotalPoints, skaterX.TotalPoints));
            }
        }
Ejemplo n.º 2
0
        private void PopulatePointsForArea(int areaCount, DataGridView dgv, Skater currSkater)
        {
            for (int i = 0; i < areaCount; i++)
            {
                if (currSkater.PointsJudge1.Count > i)
                {
                    dgv.Rows[i].Cells[1].Value = currSkater.PointsJudge1[i];
                }

                if (currSkater.PointsJudge2.Count > i)
                {
                    dgv.Rows[i].Cells[2].Value = currSkater.PointsJudge2[i];
                }

                if (currSkater.PointsJudge3.Count > i)
                {
                    dgv.Rows[i].Cells[3].Value = currSkater.PointsJudge3[i];
                }
            }
        }