Esempio n. 1
0
    public void sinColegio()
    {
        Persistencia.partida.nColegio  = "BunpoGeneral";
        Persistencia.partida.nCurso    = "CursoGeneral";
        Persistencia.partida.idColegio = 17;
        Persistencia.partida.idCurso   = 1;

        Persistencia.save();

        DataBaseMgr.nuevoEstudiante(Persistencia.partida.nombre, Persistencia.partida.idCurso, Persistencia.partida.alias, Persistencia.partida.contraseña);
        Persistencia.partida.idEstudiante = DataBaseMgr.getIdStudentAlias(Persistencia.partida.alias);
        Persistencia.save();
        SceneManager.LoadScene("SeleccionPersonaje");
    }
Esempio n. 2
0
    public void enviarDatos()
    {
        Persistencia.load();
        string filePath;
        string jsonString;

        filePath   = Application.persistentDataPath + "/partida.gd";
        jsonString = File.ReadAllText(filePath);

        Persistencia.save();
        //Debug.Log(Persistencia.partida.idEstudiante);
        DataBaseMgr.actualizarEstudiante(Persistencia.partida.idEstudiante, jsonString, Persistencia.partida.puntaje,
                                         Persistencia.partida.oner, Persistencia.partida.odif, Persistencia.partida.sner, Persistencia.partida.sdif, Persistencia.partida.vner, Persistencia.partida.vdif,
                                         Persistencia.partida.pner, Persistencia.partida.pdif, Persistencia.partida.cner, Persistencia.partida.cdif);

        llenarTabla();
    }
Esempio n. 3
0
    public void cargarCursos()
    {
        curso.ClearOptions();
        keysC.Clear();
        valuesC.Clear();

        if (keys.Count > 0)
        {
            Dictionary <int, string> cursos = DataBaseMgr.getCourses(keys[colegio.value]);
            foreach (KeyValuePair <int, string> pair in cursos)
            {
                keysC.Add(pair.Key);
                valuesC.Add(pair.Value);
            }

            curso.AddOptions(valuesC);
        }
    }
Esempio n. 4
0
    public void listo()
    {
        if (keys.Count <= 0 || keysC.Count <= 0)
        {
            mensaje.enabled = true;
        }
        else
        {
            Persistencia.partida.nColegio  = colegio.captionText.ToString();
            Persistencia.partida.nCurso    = curso.captionText.ToString();
            Persistencia.partida.idColegio = keys[colegio.value];
            Persistencia.partida.idCurso   = keysC[curso.value];



            DataBaseMgr.nuevoEstudiante(Persistencia.partida.nombre, Persistencia.partida.idCurso, Persistencia.partida.alias, Persistencia.partida.contraseña);
            Persistencia.partida.idEstudiante = DataBaseMgr.getIdStudentAlias(Persistencia.partida.alias);
            Persistencia.save();
            SceneManager.LoadScene("SeleccionPersonaje");
        }
    }
Esempio n. 5
0
    // Use this for initialization
    void Start()
    {
        colegio.ClearOptions();
        curso.ClearOptions();
        keys.Clear();
        values.Clear();
        keysC.Clear();
        valuesC.Clear();

        Dictionary <int, string> colegios = DataBaseMgr.getSchools();

        foreach (KeyValuePair <int, string> pair in colegios)
        {
            keys.Add(pair.Key);
            values.Add(pair.Value);
        }

        keys.RemoveAt(0);
        values.RemoveAt(0);

        colegio.AddOptions(values);
        cargarCursos();
    }
Esempio n. 6
0
    public void llenarTabla()
    {
        List <List <string> > tops = DataBaseMgr.getTop(Persistencia.partida.idCurso);

        try
        {
            if (tops.Count / 2 >= 1)
            {
                nombre1.text = tops[0][0];
                puntos1.text = System.Math.Round(float.Parse(tops[0][1]), 2).ToString();
            }
            if (tops.Count / 2 >= 2)
            {
                nombre2.text = tops[1][0];
                puntos2.text = System.Math.Round(float.Parse(tops[1][1]), 2).ToString();
            }
            if (tops.Count / 2 >= 3)
            {
                nombre3.text = tops[2][0];
                puntos3.text = System.Math.Round(float.Parse(tops[2][1]), 2).ToString();
            }
            if (tops.Count / 2 >= 4)
            {
                nombre4.text = tops[3][0];
                puntos4.text = System.Math.Round(float.Parse(tops[3][1]), 2).ToString();
            }
            if (tops.Count / 2 >= 5)
            {
                nombre5.text = tops[4][0];
                puntos5.text = System.Math.Round(float.Parse(tops[4][1]), 2).ToString();
            }
            if (tops.Count / 2 >= 6)
            {
                nombre6.text = tops[5][0];
                puntos6.text = System.Math.Round(float.Parse(tops[5][1]), 2).ToString();
            }
            if (tops.Count / 2 >= 7)
            {
                nombre7.text = tops[6][0];
                puntos7.text = System.Math.Round(float.Parse(tops[6][1]), 2).ToString();
            }
            if (tops.Count / 2 >= 8)
            {
                nombre8.text = tops[7][0];
                puntos8.text = System.Math.Round(float.Parse(tops[7][1]), 2).ToString();
            }
            if (tops.Count / 2 >= 9)
            {
                nombre9.text = tops[8][0];
                puntos9.text = System.Math.Round(float.Parse(tops[8][1]), 2).ToString();
            }
            if (tops.Count / 2 >= 10)
            {
                nombre10.text = tops[9][0];
                puntos10.text = System.Math.Round(float.Parse(tops[9][1]), 2).ToString();
            }
        }
        catch (System.Exception e)
        {
            e.ToString();
        }
    }