public override void PositionLoaded(FEN fen) { // read the turn number from the FEN if (!Int32.TryParse(fen["turn number"], out turnNumber)) { throw new Exception("FEN parse error - invalid turn number specified: '" + fen["turn number"] + "'"); } // read the current player from the FEN string currentPlayerNotation = fen["current player"]; if (currentPlayerNotation == "w") { Game.CurrentSide = 0; } else if (currentPlayerNotation == "b") { Game.CurrentSide = 1; } else { throw new Exception("FEN parse error - invalid current player specified: '" + currentPlayerNotation + "'"); } }
public override void SavePositionToFEN(FEN fen) { fen["turn number"] = turnNumber.ToString(); fen["current player"] = Game.CurrentSide == 0 ? "w" : "b"; }
public virtual void SetDefaultsInFEN( FEN fen ) { }
public virtual void SavePositionToFEN( FEN fen ) { }
public virtual void PositionLoaded( FEN fen ) { }