Ejemplo n.º 1
0
 public static List <Game> SerializeFromSGF(string path)
 {
     using (var sr = new StreamReader(path, Encoding.ASCII)) {
         var coll = new SGFCollection();
         coll.Read(sr);
         return(coll.GameTrees.Select(c => new Game(c)).ToList());
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Create an SGFCollection object from a stream.
        /// </summary>
        public static SGFCollection Create(Stream stream)
        {
            var sgf = new SGFCollection();

            using (var tr = new StreamReader(stream, Encoding.UTF8)) {
                sgf.Read(tr);
            }
            return(sgf);
        }