InternalMakeMove() protected method

Perform the necessary operations for a move, check liberties, capture, etc. Also updates the Move and IsLegal properties.
protected InternalMakeMove ( int x, int y ) : bool
x int The X coordinate of the move.
y int The Y coordinate of the move.
return bool
Esempio n. 1
0
File: Game.cs Progetto: serd/GoSharp
        /// <summary>
        /// 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.
        /// If the move was illegal (suicide, violating super-ko, or an overwrite), the
        /// method sets the legal parameter to false, otherwise it is set to true.
        /// </summary>
        /// <param name="x">The X coordinate of the move.</param>
        /// <param name="y">The Y coordinate of the move.</param>
        /// <param name="legal">Set to true if the move was legal, false otherwise.</param>
        /// <returns>A game object representing the state of the game after the move.</returns>
        public Game MakeMove(int x, int y, out bool legal)
        {
            var g = new Game(this);

            legal = g.InternalMakeMove(x, y);
            moves.Add(new Point(x, y), g);
            return(g);
        }
Esempio n. 2
0
 /// <summary>
 /// 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.
 /// If the move was illegal (suicide, violating super-ko, or an overwrite), the
 /// method sets the legal parameter to false, otherwise it is set to true.
 /// </summary>
 /// <param name="x">The X coordinate of the move.</param>
 /// <param name="y">The Y coordinate of the move.</param>
 /// <param name="legal">Set to true if the move was legal, false otherwise.</param>
 /// <returns>A game object representing the state of the game after the move.</returns>
 public Game MakeMove(int x, int y, out bool legal)
 {
     var g = new Game(this);
     legal = g.InternalMakeMove(x, y);
     moves.Add(new Point(x, y), g);
     return g;
 }