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