Ejemplo n.º 1
0
        public bool LoadMobList()
        {
            ReportUpdate("Mobs");

            if (File.Exists(MoblistFilepath) == false)
            {
                return(false);
            }

            XmlSerializer xml = new XmlSerializer(typeof(MobDBMobList));

            try {
                using (FileStream fs = new FileStream(MoblistFilepath, FileMode.Open)) {
                    MobDBMobList mobs = (MobDBMobList)xml.Deserialize(fs);
                    if (mobs != null && mobs.Count > 0)
                    {
                        AddRange(mobs.ToArray());
                    }
                }
            } catch {
                return(false);
            }

            if (Count == 0)
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 2
0
        public bool LoadMobList()
        {
            if (File.Exists(MoblistFilepath) == false)
            {
                return(false);
            }

            XmlSerializer xml = new XmlSerializer(typeof(MobDBMobList));

            try {
                using (FileStream fs = new FileStream(MoblistFilepath, FileMode.Open)) {
                    mMobs = (MobDBMobList)xml.Deserialize(fs);
                }
            } catch {
                return(false);
            }

            if (mMobs == null || mMobs.Count == 0)
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 3
0
 public MobDB2XML()
 {
     mMobs = new MobDBMobList();
 }