Ejemplo n.º 1
0
        public Negocio()
        {
            // Creo la Base de datos si no existia
            bd = new BD();

            listaUsuarios = new ListaUsuarios(bd);

            (new Thread(() =>
            {
                listaEquipos = new ListaEquipos(bd);
            })).Start();

            (new Thread(() =>
            {
                listaJugadores = new ListaJugadores(bd);
            })).Start();

            (new Thread(() =>
            {
                listaPartidos = new ListaPartidos(bd);
            })).Start();

            (new Thread(() =>
            {
                listaJugar = new ListaJugar(bd);
            })).Start();

            (new Thread(() =>
            {
                listaGoles = new ListaGoles(bd, listaJugadores);
            })).Start();
        }
        public List <Jugar> GetTitularesVisitantes(List <Jugar> jugadores, ListaJugadores listaJugadores)
        {
            List <Jugar> titulares = new List <Jugar>();

            foreach (Jugar j in jugadores)
            {
                if (j.EquiposVisitante == listaJugadores.GetJugador(j.NombreJugador).EquipoJugador)
                {
                    titulares.Add(j);
                }
            }

            return(titulares);
        }
        public List <Gol> GetGolesL(List <Gol> goles, ListaJugadores listaJugadores)
        {
            List <Gol> golesL = new List <Gol>();

            foreach (Gol g in goles)
            {
                if (g.EquipoLocal == listaJugadores.GetJugador(g.Jugador).EquipoJugador)
                {
                    golesL.Add(g);
                }
            }

            return(golesL);
        }
        public List <Gol> GetGolesV(List <Gol> goles, ListaJugadores listaJugadores)
        {
            List <Gol> golesV = new List <Gol>();

            foreach (Gol g in goles)
            {
                if (g.EquipoVisitante == listaJugadores.GetJugador(g.Jugador).EquipoJugador)
                {
                    golesV.Add(g);
                }
            }

            return(golesV);
        }
 public ListaGoles(BD bd, ListaJugadores listaJugadores)
 {
     this.bd             = bd;
     this.listaJugadores = listaJugadores;
     _goles = bd.LeerGoles();
 }