Ejemplo n.º 1
0
    public void BorrarJugador(string nombre, bool borrarEstadisticas)                                //Eliminar un jugador de la lista
    {
        Jugador jugador = BuscarPorNombre(nombre);

        if (jugador != null)
        {
            if (borrarEstadisticas)
            {
                foreach (var partido in jugador.GetPartidos())
                {
                    BorrarEstadisticaPartido(partido);
                }
                foreach (var practica in jugador.GetPracticas())
                {
                    BorrarEstadisticaPractica(practica);
                }
            }
            SaveSystem.BorrarJugador(nombre, this);
            jugadores.Remove(jugador);
        }
    }