private void GameLoaded(object sender, GameLoadedEventArgs e) { //_model = new TicTacToeGameModel(new TextFilePersistence(), e.datas); _model._tableSize = e.datas.tableSize; _size = _model._tableSize; _model._tableMatrix = new int[_size, _size]; _model._tableMatrix = e.datas.table; _model._currentPlayer = e.datas.currentPlayer; _model._placed = e.datas.placed; _model._xTime = e.datas.xTime; _model._oTime = e.datas.oTime; _model._timerOn = true; _panel.Refresh(); }
private void Model_GameLoaded(object sender, GameLoadedEventArgs e) { _model._tableSize = e.datas.tableSize; _model._currentPlayer = e.datas.currentPlayer; _model._oTime = e.datas.oTime; _model._xTime = e.datas.xTime; _model._placed = e.datas.placed; _model._tableMatrix = new int[_model._tableSize, _model._tableSize]; for (int i = 0; i < _model._tableSize; ++i) { for (int j = 0; j < _model._tableSize; j++) { _model._tableMatrix[i, j] = e.datas.table[i, j]; } } Refresh(); }
private void OnGameLoaded(System.Object o, GameLoadedEventArgs args) { ChessGame game = new ChessGame (args.Game); if (GameViewer.GameDb == null) games.Add (game); else { ChessGame dbgame; if (!GameViewer.GameDb. GetGameDetails (game, out dbgame)) { // not found in the db dbgame = game; } games.Add (dbgame); } viewer.ProgressBar.Text = Catalog.GetString ("Loaded ") + games.Count + Catalog.GetString (" games"); viewer.ProgressBar.Pulse (); while (Gtk.Application.EventsPending ()) Gtk.Application.RunIteration (); }
private void OnGameLoaded(object o, GameLoadedEventArgs args) { PGNChessGame game = args.Game; Opening opening = new Opening (); opening.ecoName = game.GetTagValue ("Site", null); opening.name = game.GetTagValue ("White", null); opening.variation = game.GetTagValue ("Black", null); opening.moves = game.Moves; if (opening.ecoName != null && opening.name != null) db.AddOpening (opening); else Console.WriteLine (Catalog. GetString ("skipping this opening. econame = [{0}], name = [{1}]"), opening.ecoName, opening.name); }