Example #1
0
        public void RemoveGame(Game g)
        {
            if (!GameExistsInLibrary (g))
                return;

            _games.Remove (FindGameInLibrary (g.Title));
        }
Example #2
0
 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;
 }
Example #3
0
        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;
        }
Example #4
0
            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);
            }
Example #5
0
        public MenuGameWidget(Game game)
        {
            //4this.Build ();

            _game = game;
        }
Example #6
0
 public void Insert(Game localGame)
 {
     if(!Exists(localGame))
         _database.Insert(localGame);
 }
Example #7
0
 public bool Exists(Game game)
 {
     return _database.Table<Game> ().Any (g => g.GetHashCode() == game.GetHashCode());
 }
Example #8
0
 private void AddGame(Game g)
 {
     _games.Add (g);
     if(!DatabaseManager.Instance.Exists(g))
         DatabaseManager.Instance.Insert (g);
 }