MakeMove() 공개 메소드

Makes a move and returns a new Game object representing the state after the move. The move is carried out whether it is legal or illegal (for example, an overwrite move). The color of the move is determined by the Turn property. The legality of the move may be determined by examining the IsLegal property of the returned object.
public MakeMove ( Point n ) : Game
n Point The coordinates of the move.
리턴 Game
예제 #1
0
파일: Program.cs 프로젝트: paviad/GoSharp
        static void Main(string[] args)
        {
            var gi = new GameInfo();
            var g = new Game(gi);
            g.SetupMove(1, 3, Content.Black);
            g.SetupMove(1, 4, Content.Black);
            g.SetupMove(2, 2, Content.Black);
            g.SetupMove(2, 5, Content.Black);
            g.SetupMove(3, 3, Content.Black);
            g.SetupMove(3, 1, Content.Black);
            g.SetupMove(4, 1, Content.Black);
            g.SetupMove(5, 2, Content.Black);

            g.SetupMove(2, 3, Content.White);
            g.SetupMove(2, 4, Content.White);
            g.SetupMove(3, 2, Content.White);
            g.SetupMove(3, 4, Content.White);
            g.SetupMove(3, 5, Content.White);
            g.SetupMove(4, 2, Content.White);
            g.SetupMove(4, 4, Content.White);
            g.SetupMove(5, 3, Content.White);

            Console.WriteLine("{0}", g.Board);
            var result = g.MakeMove(4, 3);
            Console.WriteLine("{0}", result.Board);
        }
예제 #2
0
파일: GameTest.cs 프로젝트: nerai/GoSharp
 public void SerializeToSGFTest1()
 {
     GameInfo gi = new GameInfo();
     gi.BoardSizeX = gi.BoardSizeY = 9;
     gi.FreePlacedHandicap = false;
     gi.Handicap = 3;
     gi.Komi = 7.5;
     gi.StartingPlayer = Content.White;
     Game target = new Game(gi);
     target.SetupMove(5, 5, Content.Black);
     target.SetupMove(6, 5, Content.Black);
     target.SetupMove(8, 5, Content.White);
     target.MakeMove(5, 7).MakeMove(6, 7);
     target.MakeMove(5, 8);
     string expected = @"(;AB[cc][gg][gc][ff][gf]AW[if]HA[3]PL[W]KM[7.50]SZ[9](;W[fh];B[gh])(;W[fi]))";
     string actual;
     actual = target.SerializeToSGF(null);
     Assert.AreEqual(expected, actual);
 }