/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { //IsMouseVisible = true; ControlSystem.Initialize(GraphicsDevice); ControlSystem.HandleInFormOnly = true; ControlSystem.EffectVolume = Settings.Default.EffectVolume; ControlSystem.BackgroundVolume = Settings.Default.BackgroundVolume; ResourceManager.Initialize(GraphicsDevice, Content); mouseImg = ResourceManager.LoadImage("Cursor/Cursor"); mouseDownImg = ResourceManager.LoadImage("Cursor/CursorDown"); GraphicsDevice.DeviceReset += new EventHandler <EventArgs>(GraphicsDevice_DeviceReset); titleGame = new TitleGame(); titleGame.SwitchGameEventHandler = ChooseGame; mainMenuGame = new MainMenuGame(); mainMenuGame.SwitchGameEventHandler = ChooseGame; classicalGame = new ClassicalGame(); classicalGame.SwitchGameEventHandler = ChooseGame; currentGame = titleGame; base.Initialize(); }
private void btn_AddWishList_Click(object sender, EventArgs e) { TitleGame wishgame = new TitleGame(); Response <GameDTOs> temp = GameControllerShould.GetGameByIdController(currGame.Id.ToString()); //if (user_wishgame != null) //{ // foreach(GameObject a in user_wishgame) // { // if (temp.Payload.Id == a.Id) // { // MessageBox.Show("Game already exist in wishlist", "Error"); // return; // } // } //} //user_wishgame.Add(toGameObject(temp.Payload)); wishgame.Id = temp.Payload.Id; wishgame.ImageGames = temp.Payload.ImageGames; wishgame.Name = temp.Payload.Name; wishgame.ReleaseDate = temp.Payload.PurchaseDate; //User.Password = currPass; //var response = AccountsControllerShould.UpdateAccountController(User, this.id); var response = AccountsControllerShould.PostAccountLikeGameController(new BuyGameObject(this.currGame.Id.ToString()), this.id); if (response == "False") { MessageBox.Show("Fail or Duplicate game to add to wishlist", "Error"); } else { User.WishGames.Add(wishgame); MessageBox.Show("Wish list updated", "Success"); } }