private static void LoadUserEngine(Game game, int engineID, int chessTypeID, string bookFile) { DataSet dataset = SocketClient.GetSetIntruptedGameUserEngine(engineID, UserStatusE.Playing); if (dataset != null && dataset.Tables.Count > 0) { if (dataset.Tables[0] != null && dataset.Tables[0].Rows.Count > 0) { App.Model.Db.Engine engine = new App.Model.Db.Engine(Ap.Cxt, dataset.Tables[0].Rows[0]); InfinitySettings.EngineManager.EngineManager objEngineManager = new InfinitySettings.EngineManager.EngineManager(); List <InfinitySettings.EngineManager.Engine> lstEngine = objEngineManager.LoadEngines(); InfinitySettings.EngineManager.Engine eng = lstEngine.Where(x => x.IsActive == true && x.EngineTitle.Replace(".exe", "") == engine.Name).FirstOrDefault(); if (eng != null) { UCIEngine selectedEngine = new UCIEngine(eng.FilePath, Ap.EngineOptions.HashTableSize, game); selectedEngine.Load(); selectedEngine.Close(); Ap.PlayingMode.SelectedEngine = selectedEngine; Ap.PlayingMode.ChessTypeID = chessTypeID; Ap.PlayingMode.SelectedBook = new Book(game, bookFile); } } } }
private static void SetUserEngine(Game game) { if (game.DbGame.IsCurrentUserWhite && game.DbGame.WhiteChessTypeIDE == ChessTypeE.Engine) { LoadUserEngine(game, game.DbGame.WhiteEngineID, game.DbGame.WhiteChessTypeID, Ap.EngineOptions.WhiteBook); } else if (game.DbGame.IsCurrentUserBlack && game.DbGame.BlackChessTypeIDE == ChessTypeE.Engine) { LoadUserEngine(game, game.DbGame.BlackEngineID, game.DbGame.BlackChessTypeID, Ap.EngineOptions.WhiteBook); } else { SocketClient.GetSetIntruptedGameUserEngine(1, UserStatusE.Playing); Ap.CurrentUser.EngineID = 1; Ap.PlayingMode.SelectedEngine = null; Ap.PlayingMode.ChessTypeID = 1; } }
public ChatUc(App.Model.Game game) { this.Game = game; InitializeComponent(); }
public PlayingMode(App.Model.Game game) { this.Game = game; InitializeComponent(); }
public MainOnline(Game game) : base(game) { InitializeComponent(); }
public PGNReader(App.Model.Game game) { this.Game = game; }