private List<DBGameState> GenerateStates(DBGame dbGame, int id) { var result = new List<DBGameState>(); var num = 1; do { var gs = new DBGameState { FEN = ((ChessState)dbGame.Game.State).ToStringShort(), Games = dbGame, Num = num++, Game = id }; dbGame.GameStates.Add(gs); result.Add(gs); } while (dbGame.Game.MakeMove()); while (dbGame.Game.UndoMove()) { } return result; }
/// <summary> /// Create a new DBGameState object. /// </summary> /// <param name="game">Initial value of the Game property.</param> /// <param name="num">Initial value of the Num property.</param> public static DBGameState CreateDBGameState(global::System.Int32 game, global::System.Int32 num) { DBGameState dBGameState = new DBGameState(); dBGameState.Game = game; dBGameState.Num = num; return dBGameState; }
/// <summary> /// Deprecated Method for adding a new object to the GameStates EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToGameStates(DBGameState dBGameState) { base.AddObject("GameStates", dBGameState); }