示例#1
0
        private Color getRoundScoreColor(Round round)
        {
            var score = _mode.GetScore(round);

            if (score >= 100)
            {
                return Color.Cyan;
            }
            if (score >= 150)
            {
                return Color.Magenta;
            }

            return Color.White;
        }
示例#2
0
        /// <summary>
        ///     Checks if any conditions for the awards are met and plays the award video
        /// </summary>
        public void PlayAwards(Round round)
        {
            if (!XnaDartsGame.Options.PlayAwards)
            {
                return;
            }

            if (isTonEighty(round))
            {
                play(AwardCue.TonEighty);
            }
            else if (isThreeInTheBlack(round))
            {
                //Play award three in the black
                play(AwardCue.ThreeInTheBlack);
            }
            else if (isHatTrick(round))
            {
                //Play award hattrick!
                play(AwardCue.HatTrick);
            }
            else if (isHighTon(round))
            {
                play(AwardCue.HighTon);
            }
            else if (isLowTon(round))
            {
                //Play award low ton!
                play(AwardCue.LowTon);
            }
            else if (isThreeInABed(round))
            {
                play(AwardCue.ThreeInABed);
            }
        }
示例#3
0
 private bool isTonEighty(Round round)
 {
     return round.GetScore() == 180;
 }
示例#4
0
 private bool isThreeInTheBlack(Round round)
 {
     return round.Darts.TrueForAll(
         dart => dart.Segment == 25 &&
                 dart.Multiplier == 2);
 }
示例#5
0
 private bool isThreeInABed(Round round)
 {
     return round.Darts.All(x =>
         x.Segment != 0 &&
         x.Multiplier != 1 &&
         x.Segment == round.Darts[0].Segment &&
         x.Multiplier == round.Darts[0].Multiplier);
 }
示例#6
0
 private bool isLowTon(Round round)
 {
     return round.GetScore() >= 100;
 }
示例#7
0
 private bool isHighTon(Round round)
 {
     return round.GetScore() > 150;
 }
示例#8
0
 private bool isHatTrick(Round round)
 {
     return round.Darts.TrueForAll(dart => dart.Segment == 25);
 }