private static void Load()
        {
            string path = Path.Combine(Core.BaseDirectory, @"Data\mustangs.xml");

            if (!File.Exists(path))
            {
                return;
            }

            FileStream stream = null;

            try
            {
                stream = new FileStream(path, FileMode.Open, FileAccess.Read);
                XmlSerializer serializer = new XmlSerializer(typeof(MustangCollection));
                m_Mustangs = serializer.Deserialize(stream) as MustangCollection;
            }
            catch {}
            finally
            {
                if (stream != null)
                {
                    stream.Close();
                }
            }

            if (m_Mustangs == null)
            {
                m_Mustangs = new MustangCollection();
            }

            m_Mustangs.List.Insert(0, MustangInfo.Default);
        }
	    private static void Load()
		{
			string path = Path.Combine( Core.BaseDirectory, @"Data\mustangs.xml" );

			if ( ! File.Exists( path ) )
				return;

			FileStream stream = null;

			try
			{
				stream = new FileStream( path, FileMode.Open, FileAccess.Read );
				XmlSerializer serializer = new XmlSerializer( typeof( MustangCollection ) );
				m_Mustangs = serializer.Deserialize( stream ) as MustangCollection;
			}
			catch{}
			finally
			{
				if ( stream != null )
					stream.Close();
			}

			if ( m_Mustangs == null )
				m_Mustangs = new MustangCollection();

			m_Mustangs.List.Insert( 0, MustangInfo.Default );
		}
Exemple #3
0
 public Mustang(string name) : this(MustangCollection.FromString(name))
 {
 }
Exemple #4
0
 public Mustang(int minSkill, int maxSkill) : this(MustangCollection.FromSkills(minSkill, maxSkill))
 {
 }
Exemple #5
0
 public Mustang() : this(MustangCollection.Randomize())
 {
 }