Exemplo n.º 1
0
 public override void OnLevelUnloading()
 {
     try
     {
         XML_VersionOne xml = new XML_VersionOne();
         xml.writeXML(currentFileLocation);
     }
     catch (Exception e)
     {
         Debugging.panelWarning(e.Message);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        private void readFromXML()
        {
            bool fileAvailable = File.Exists(currentFileLocation);
            bool[] defaultMath = null;

            if (fileAvailable)
            {
                // Load in from XML - Designed to be flat file for ease
                XmlDocument doc = new XmlDocument();
                try
                {
                    doc.Load(currentFileLocation);

                    XML_VersionOne reader = new XML_VersionOne();
                    defaultMath = reader.readXML(doc);
                }
                catch (Exception e)
                {
                    // Game will now use defaults
                    Debugging.panelMessage(e.Message);
                }
            }
            else
            {
                Debugging.panelMessage("Configuration file not found. Will output new file to : " + currentFileLocation);
            }

            doMathDefaults(defaultMath);
        }