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);
        }
Beispiel #2
0
	    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 );
		}
Beispiel #3
0
 public Mustang(string name) : this(MustangCollection.FromString(name))
 {
 }
Beispiel #4
0
 public Mustang(int minSkill, int maxSkill) : this(MustangCollection.FromSkills(minSkill, maxSkill))
 {
 }
Beispiel #5
0
 public Mustang() : this(MustangCollection.Randomize())
 {
 }