Пример #1
0
        public GoBoard(GoBoard goBoard, bool includeUndo)
        {
            Coord = CoordinateSystem.GetCoordinateSystem(goBoard.BoardSize);
            SafetySolver = goBoard.SafetySolver;
            Komi = goBoard.Komi;
            Clear();

            foreach (KeyValuePair<Color, int> lMove in goBoard.MoveList)
                PlayStone(lMove.Value, lMove.Key, includeUndo);
        }
Пример #2
0
        public static List<Result> Filter(GameRecords gameRecords, FilterFunction filterFunction)
        {
            List<Result> lResults = new List<Result>();

            foreach (GameRecord lGameRecord in gameRecords)
            {
                CoordinateSystem lCoord = new CoordinateSystem(lGameRecord.BoardSize);
                GoBoard lGoBoard = new GoBoard(lGameRecord.BoardSize);

                for (int i = 0; i < lGameRecord.Count - 1; i++)
                {
                    lGoBoard.PlayStone(lGameRecord[i].Move, lGameRecord[i].Player, false);

                    int lNextMove;
                    Color lNextPlayer;

                    if (i >= lGameRecord.Count)
                    {
                        lNextMove = CoordinateSystem.PASS;
                        lNextPlayer = Color.Empty;
                    }
                    else
                    {
                        lNextMove = lGameRecord[i + 1].Move;
                        lNextPlayer = lGameRecord[i + 1].Player;
                    }

                    if (filterFunction(lGoBoard, lGameRecord[i].Player, lGameRecord[i].Move, lNextPlayer, lNextMove))
            //                    {
            //                        Console.WriteLine(lGameRecord.GameName + " (" + i.ToString() + ") ->  " + lCoord.ToString(lNextMove));
                        lResults.Add(new Result(lGameRecord, i));
            //                    }
                }
            }

            return lResults;
        }
Пример #3
0
        private static CoordinateSystem[] BuildCoordinateMatrix(int pUpToSize)
        {
            CoordinateSystem[] lCoordinateSystem = new CoordinateSystem[pUpToSize+1];

            for (int i = 1; i <= pUpToSize; i++)
                lCoordinateSystem[i] = new CoordinateSystem(i);

            return lCoordinateSystem;
        }
Пример #4
0
 public GoBoard(int boardSize)
 {
     Coord = CoordinateSystem.GetCoordinateSystem(boardSize);
     SafetySolver = SafetySolverType.Muller04;
     Clear();
 }
Пример #5
0
 public void SetBoardSize(int boardSize)
 {
     Coord = CoordinateSystem.GetCoordinateSystem(boardSize);
     Clear();
 }