-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I switch turns for each move? #32
Comments
Hello, every GameInfo gi = new GameInfo() { Handicap = 0, StartingPlayer = Content.Black, Komi = 6.5 };
Game gameInitial = new Game(gi);
Game game = gameInitial;
bool legal;
game = game.MakeMove(3, 3, out legal);
game = game.MakeMove(16, 16, out legal);
Debug.Log(game.SerializeToSGF(null)); |
Thank you for reply! protected Game(Game fromGame) {
Board = new Board(fromGame.Board);
Turn = fromGame.Turn.Opposite();
GameInfo = fromGame.GameInfo; // I added this line
_captures[Content.White] = fromGame._captures[Content.White];
_captures[Content.Black] = fromGame._captures[Content.Black];
foreach (var p in fromGame._superKoSet) _superKoSet.Add(p);
Root = fromGame.Root;
} With this fix, game properties such as Komi and size are now output, but Moves is stille not. private void SerializeToSGFInternal(TextWriter s) {
if (_moves.Count == 1) { // I set a breakpoint here, but the Count was 0.
var pnt = _moves.First().Move;
SerializeMove(s, pnt);
_moves.First().Game.SerializeToSGF(s);
}
} |
How do I switch turns for each move?
I have written the following code.
What I get is this kind of SGF. It is a variation move of Black's first move and does not advance the number of moves.
What I want is an SGF like this one.
The text was updated successfully, but these errors were encountered: