示例#1
0
        public int DevolverNumerodeunidadesdest(NodoArbol aux)
        {
            NodoListaJuegos auxiliar = aux.GetListaJuegos().GetPrimero();
            int             n        = 0;

            while (auxiliar != null)
            {
                if (auxiliar.GetGano())
                {
                    n += auxiliar.GetUnidadesDestruidas();
                }
                auxiliar = auxiliar.GetSiguiente();
            }
            return(n);
        }
示例#2
0
        public int DevolverJuegosGanados(NodoArbol aux)
        {
            NodoListaJuegos auxiliar = aux.GetListaJuegos().GetPrimero();
            int             cont     = 0;

            while (auxiliar != null)
            {
                if (auxiliar.GetGano())
                {
                    cont++;
                }
                auxiliar = auxiliar.GetSiguiente();
            }
            return(cont);
        }
示例#3
0
        public double DevolverPorcentajeUnidadesDest(NodoArbol aux)
        {
            NodoListaJuegos auxiliar = aux.GetListaJuegos().GetPrimero();
            double          n        = 0;
            double          n1       = 0;//dest

            while (auxiliar != null)
            {
                if (auxiliar.GetGano())
                {
                    n  += auxiliar.GetUnidadesDesplegadas();
                    n1 += auxiliar.GetUnidadesDestruidas();
                }
                auxiliar = auxiliar.GetSiguiente();
            }
            return((n1 * 100) / n);
        }
示例#4
0
        private string GraficarListaJuegos(ListaJuegos lista, string lugar)
        {
            string          aux  = "";
            NodoListaJuegos aux1 = lista.GetPrimero();
            int             cont = 0;

            while (aux1 != null)
            {
                aux += "lj" + lugar + cont.ToString() + "[label = \"Jugador Base: " + aux1.GetJugador() + "\\nOponente: " + aux1.GetOponente() + "\\nUnidades Desplegadas: " + aux1.GetUnidadesDesplegadas().ToString() + "\\nUnidades Sobrevivientes: " + aux1.GetUnidadesSobrevivientes().ToString();
                aux += "\\nUnidades Destruidas: " + aux1.GetUnidadesDestruidas();
                if (aux1.GetGano())
                {
                    aux += "\\nGano la partida\"];\n";
                }
                else
                {
                    aux += "\\nPerdio la partida\"];\n";
                }
                aux1 = aux1.GetSiguiente();
                cont++;
            }

            aux1 = lista.GetPrimero();
            cont = 0;
            while (lista.GetPrimero() != null && aux1 != null && lista.GetPrimero() != lista.GetUltimo())
            {
                if (aux1 == lista.GetPrimero())
                {
                    aux += "lj" + lugar + cont.ToString() + "->lj" + lugar + (cont + 1).ToString() + "\n";
                }
                else if (aux1 == lista.GetUltimo())
                {
                    aux += "lj" + lugar + cont.ToString() + "->lj" + lugar + (cont - 1).ToString() + "\n";
                }
                else
                {
                    aux += "lj" + lugar + cont.ToString() + "->lj" + lugar + (cont + 1).ToString() + "\n";
                    aux += "lj" + lugar + cont.ToString() + "->lj" + lugar + (cont - 1).ToString() + "\n";
                }
                aux1 = aux1.GetSiguiente();
                cont++;
            }
            return(aux);
        }
示例#5
0
        public string DevolverDatos(string jugador1, string jugador2, int unidadesdes, int unidadessob, int unidadesdest)
        {
            NodoListaJuegos aux = this.primero;
            string          dev = "";

            while (aux != null)
            {
                if (aux.GetJugador().CompareTo(jugador1) == 0 && aux.GetOponente().CompareTo(jugador2) == 0 && aux.GetUnidadesDesplegadas() == unidadesdes && aux.GetUnidadesSobrevivientes() == unidadessob && aux.GetUnidadesDestruidas() == unidadesdest)
                {
                    dev = aux.GetJugador() + "," + aux.GetOponente() + "," + aux.GetUnidadesDesplegadas().ToString() + "," + aux.GetUnidadesSobrevivientes().ToString() + "," + aux.GetUnidadesDestruidas().ToString() + "," + aux.GetGano().ToString();
                }
                aux = aux.GetSiguiente();
            }
            return(dev);
        }