Пример #1
0
        public Frame Roll(uint pins)
        {
            if (IsFull)
            {
                if (NextFrame != null)
                {
                    return(NextFrame.Roll(pins));
                }

                return(null);
            }

            if (!IsValidRoll(pins))
            {
                throw new InvalidRollException($"Invalid roll > {MaxValidRoll}");
            }

            var roll = new Roll(pins);

            Rolls.Add(roll);

            if (IsFull)
            {
                return(NextFrame);
            }

            return(this);
        }