Example #1
0
 public NodoArbol(string pnickname, string ppassword, string pcorreo, bool pconectado)
 {
     this.nickname      = pnickname;
     this.password      = ppassword;
     this.correo        = pcorreo;
     this.conectado     = pconectado;
     this.juegos        = new ListaJuegos();
     this.hijoderecho   = null;
     this.hijoizquierdo = null;
 }
Example #2
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);
        }