示例#1
0
        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;
        }
示例#2
0
 /// <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;
 }
示例#3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the GameStates EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToGameStates(DBGameState dBGameState)
 {
     base.AddObject("GameStates", dBGameState);
 }