예제 #1
0
파일: GoBoard.cs 프로젝트: tgiphil/GoTraxx
        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
파일: GoBoard.cs 프로젝트: tgiphil/GoTraxx
 public GoBoard(int boardSize)
 {
     Coord = CoordinateSystem.GetCoordinateSystem(boardSize);
     SafetySolver = SafetySolverType.Muller04;
     Clear();
 }
예제 #5
0
파일: GoBoard.cs 프로젝트: tgiphil/GoTraxx
 public void SetBoardSize(int boardSize)
 {
     Coord = CoordinateSystem.GetCoordinateSystem(boardSize);
     Clear();
 }