Example #1
0
        internal PgnTagSectionSyntax(PgnGameSyntax parent, GreenPgnTagSectionSyntax green)
        {
            Parent = parent;
            Green  = green;

            TagPairNodes = new SafeLazyObjectCollection <PgnTagPairSyntax>(
                green.TagPairNodes.Count,
                index => new PgnTagPairSyntax(this, index, Green.TagPairNodes[index]));
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of <see cref="GreenPgnGameSyntax"/>.
        /// </summary>
        /// <param name="tagSection">
        /// The tag section of the game.
        /// </param>
        /// <param name="plyList">
        /// The ply list of the game.
        /// </param>
        /// <param name="gameResult">
        /// The result of the game. This is an optional parameter.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="tagSection"/> and/or <paramref name="plyList"/> is null.
        /// </exception>
        public GreenPgnGameSyntax(
            GreenPgnTagSectionSyntax tagSection,
            GreenPgnPlyListSyntax plyList,
            GreenWithTriviaSyntax gameResult)
        {
            TagSection = tagSection ?? throw new ArgumentNullException(nameof(tagSection));
            PlyList    = plyList ?? throw new ArgumentNullException(nameof(plyList));
            GameResult = gameResult;

            Length = tagSection.Length + plyList.Length + GameResultLength;
        }