private bool guardar() { var player_current = new Core.Controller.Player(); player_current.Nickname = nickname_current; player_current.Lifes = Settings.HeartsTotal; var score_old = player_current.verifyPlayer(); if (score_old > Settings.Score) { MessageBox.Show($"Ups {player_current.Nickname}, tu puntaje fue menor al de la vez anterior, seguiremos guardnado el mayor puntaje!"); return(true); } else { if (player_current.IdPlayer != 0) { var game = new Core.Controller.Game(); game.IdPlayer = player_current.IdPlayer; game.Duration = Settings.TiempoJuado1; game.Score = Settings.Score; return(game.endGame()); } else { player_current.createPlayer(); var game = new Core.Controller.Game(); game.IdPlayer = player_current.IdPlayer; if (game.startGame()) { game.Duration = Settings.TiempoJuado1; game.Score = Settings.Score; return(game.endGame()); } } } return(false); }
//Metodo para cargar el top 10 de jugadores public void cargar() { var gm = new Core.Controller.Game(); dgv_records.DataSource = gm.viewTopPlayers(); }