Exemple #1
0
        public bool IsSpare() // Перевірка чи є фрейм спеаром
        {
            if (!firstThrow.IsStrike() && ((firstThrow.GetScore() + secondThrow.GetScore()) == 10))
            {
                return(true);
            }

            return(false);
        }
Exemple #2
0
        protected int score;                                  // Очки за фрейм

        public Frame(FirstThrow fThrow, AbstractThrow sThrow) // Конструктор
        {
            firstThrow = fThrow;

            if (!firstThrow.IsStrike())
            {
                secondThrow = sThrow;
                score       = firstThrow.GetScore() + secondThrow.GetScore();
            }
            else
            {
                score = firstThrow.GetScore();
            }
        }
Exemple #3
0
        public SecondThrow(int[] indexes, FirstThrow fThrow) // Конструктор
        {
            bool [] fPins = fThrow.GetPins();

            int count = 0;

            foreach (int i in indexes)
            {
                if (i > 0 && i < 11)
                {
                    if (fPins[i - 1] == true)
                    {
                        pins[i - 1] = true;
                        count++;
                    }
                }
            }

            score = 10 - count - fThrow.GetScore();
        }