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

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

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