public void RemoveGame(Game g) { if (!GameExistsInLibrary (g)) return; _games.Remove (FindGameInLibrary (g.Title)); }
public bool AddGame(string title, string path, string version, string hostPath) { Game g = new Game{ Title = title, Path = path, Version = version, HostPath = hostPath }; if (GameExistsInLibrary (g)) return false; AddGame (g); return true; }
public bool GameExistsInLibrary(Game g) { try { var game = FindGameInLibrary (g.Title); if (g.Title == game.Title) return true; } catch (InvalidOperationException ex) { Console.WriteLine ("Invalid operation: " + ex.Message + ". This probably means no game with the title was found."); return false; } catch (Exception ex) { Console.WriteLine (ex.GetType ()); } return false; }
public MyFixed(Game game) { _game = game; _label = new Label {Text = _game.Title}; _button = new Button { Label = "Run" }; _button.Clicked += (sender, e) => { Task.Run (() => _game.Launch()); }; Put(_button, 0, 0); Put(_label, 50, 0); }
public MenuGameWidget(Game game) { //4this.Build (); _game = game; }
public void Insert(Game localGame) { if(!Exists(localGame)) _database.Insert(localGame); }
public bool Exists(Game game) { return _database.Table<Game> ().Any (g => g.GetHashCode() == game.GetHashCode()); }
private void AddGame(Game g) { _games.Add (g); if(!DatabaseManager.Instance.Exists(g)) DatabaseManager.Instance.Insert (g); }