Exemplo n.º 1
0
    public void Save()
    {
        //New Highscores class under the refernce data
        SaveData data = new SaveData();

        //New temp string name
        string[] name = new string[10];
        //New temp string number
        int[] number = new int[10];
        //For every strut in the high array
        for (int i = 0; i < saveSlots.Length; i++)
        {
            data.playerName[i] = saveSlots[i].player;
            //Set data in wave in location i of the array to high in location i of the struts int wave
            data.level[i] = saveSlots[i].level;
            data.turn[i]  = saveSlots[i].turn;
        }
        //Write the Variable data to an XML file
        XMLSaving.WriteData(data);
    }
Exemplo n.º 2
0
    //Save the highscore data
    public void Save()
    {
        //New Highscores class under the refernce data
        HighScores data = new HighScores();

        //New temp string name
        string[] name = new string[10];
        //New temp string number
        int[] number = new int[10];
        //For every strut in the high array
        for (int i = 0; i < high.Length; i++)
        {
            //Set data in playername in location i of the array to high in location i of the struts string player
            data.playerName[i] = high[i].player;
            //Set data in distance in location i of the array to high in location i of the struts int wave
            data.wave[i] = high[i].dis;
        }
        //Write the Variable data to an XML file
        XMLSaving.WriteData(data);
    }