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";
 }
Exemplo n.º 3
0
		public virtual void SetDefaultsInFEN( FEN fen )
		{ }
Exemplo n.º 4
0
		public virtual void SavePositionToFEN( FEN fen )
		{ }
Exemplo n.º 5
0
		public virtual void PositionLoaded( FEN fen )
		{ }