Exemplo n.º 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;
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 3
0
 private bool isTonEighty(Round round)
 {
     return round.GetScore() == 180;
 }
Exemplo n.º 4
0
 private bool isThreeInTheBlack(Round round)
 {
     return round.Darts.TrueForAll(
         dart => dart.Segment == 25 &&
                 dart.Multiplier == 2);
 }
Exemplo n.º 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);
 }
Exemplo n.º 6
0
 private bool isLowTon(Round round)
 {
     return round.GetScore() >= 100;
 }
Exemplo n.º 7
0
 private bool isHighTon(Round round)
 {
     return round.GetScore() > 150;
 }
Exemplo n.º 8
0
 private bool isHatTrick(Round round)
 {
     return round.Darts.TrueForAll(dart => dart.Segment == 25);
 }