예제 #1
0
        /// <summary>
        /// Initializes a new instance of the PgnReader class.
        /// </summary>
        /// <param name="stream">A <see cref="TextReader"/> pointing to the pgn file.</param>
        /// <param name="encoding">The encoding.</param>
        /// <param name="bufferSize">The buffer size in bytes.</param>
        /// <exception cref="ArgumentNullException">
        ///   <paramref name="stream"/> is a <see langword="null"/>.
        ///   </exception>
        ///
        /// <exception cref="ArgumentException">
        /// Cannot read from <paramref name="stream"/>.
        ///   </exception>
        public PgnReader(TextReader reader, int bufferSize)
        {
            _statemachine = new PgnParserStatemachine();

            BufferSize = bufferSize;

            _games        = new List <PgnGame>();
            _reader       = reader;
            _readerBuffer = new char[BufferSize];
        }
예제 #2
0
 public RecursiveVariationState(PgnParserStatemachine reader)
     : base(reader)
 {
 }
예제 #3
0
 protected PgnParserState(PgnParserStatemachine statemachine, int stateBufferSize = 255)
 {
     _statemachine = statemachine;
     _stateBuffer  = new List <char>(stateBufferSize);
     _history      = new Stack <PgnParserState>();
 }
예제 #4
0
 public TagSectionState(PgnParserStatemachine reader)
     : base(reader)
 {
 }
예제 #5
0
 public AnnotationState(PgnParserStatemachine reader)
     : base(reader)
 {
 }