Пример #1
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);
    }