Exemplo n.º 1
0
        public PBN(string filename, int lowBoard, int highBoard)
        {
            this.handRecords = new HandRecord[highBoard + 1];
            this.ddTables    = new DDTable[highBoard + 1];

            this.lowBoard  = lowBoard;
            this.highBoard = highBoard;

            this._count = 0;
            PBNFile pbn = new PBNFile(filename);

            foreach (PBNBoard board in pbn.Boards)
            {
                int boardNo = Int32.Parse(board.GetNumber());
                if (lowBoard <= boardNo && boardNo <= highBoard)
                {
                    this.handRecords[boardNo] = new HandRecord(board.GetLayout());
                    this.ddTables[boardNo]    = new DDTable(board);
                    this._count++;
                }
            }
            if (this._count == 0)
            {
                throw new Exception("PBN nie zawiera rozdań z zadanego przedziału");
            }
            if (pbn.Boards.Count > 0 && pbn.Boards[0].HasField("Event"))
            {
                this._title = pbn.Boards[0].GetField("Event");
            }
        }
Exemplo n.º 2
0
        public PBN(string filename, int lowBoard, int highBoard)
        {
            this.handRecords = new HandRecord[highBoard + 1];
            this.ddTables = new DDTable[highBoard + 1];

            this.lowBoard = lowBoard;
            this.highBoard = highBoard;

            this._count = 0;
            PBNFile pbn = new PBNFile(filename);
            foreach (PBNBoard board in pbn.Boards)
            {
                int boardNo = Int32.Parse(board.GetNumber());
                if (lowBoard <= boardNo && boardNo <= highBoard)
                {
                    this.handRecords[boardNo] = new HandRecord(board.GetLayout());
                    this.ddTables[boardNo] = new DDTable(board);
                    this._count++;
                }
            }
        }