Exemple #1
0
        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);
        }
Exemple #2
0
 /// <summary>
 /// Constructs a root game object, along with a complete game tree from
 /// the specified SGFGameTree object.
 /// </summary>
 /// <param name="sgfGameTree">The SGF game tree object.</param>
 public Game(SGFGameTree sgfGameTree)
 {
     //GameInfo = CreateGameInfoFromSGF(sgfGameTree);
     //InitializeFromGameInfo();
     GameInfo = new GameInfo() { FreePlacedHandicap = true };
     CreateGameTree(sgfGameTree, this);
 }
Exemple #3
0
 /// <summary>
 /// Constructs a root game object based on a GameInfo object.
 /// </summary>
 /// <param name="gi">The GameInfo object.</param>
 public Game(GameInfo gi)
 {
     GameInfo = gi;
     InitializeFromGameInfo();
 }
Exemple #4
0
 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);
 }
Exemple #5
0
 /// <summary>
 /// Constructs a root game object based on a GameInfo object.
 /// </summary>
 /// <param name="gi">The GameInfo object.</param>
 public Game(GameInfo gi)
 {
     GameInfo = gi;
     InitializeFromGameInfo();
 }