Exemplo n.º 1
0
        public void CreateInfoArmorDatabaseXML(InfoArmorDatabase database, string destinyFolder)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(InfoArmorDatabase));
            FileStream    stream     = new FileStream(destinyFolder + nameXMLFile, FileMode.Create);

            serializer.Serialize(stream, database);
            stream.Close();
        }
Exemplo n.º 2
0
        public InfoArmorDatabase LoadInfoArmorDatabaseXML(string sourceFolder)
        {
            XmlSerializer     serializer = new XmlSerializer(typeof(InfoArmorDatabase));
            FileStream        stream     = new FileStream(sourceFolder + nameXMLFile, FileMode.Open);
            InfoArmorDatabase iad        = serializer.Deserialize(stream) as InfoArmorDatabase;

            stream.Close();
            return(iad);
        }
Exemplo n.º 3
0
        public InfoArmorDatabase GetAllArmorsInInventory()
        {
            InfoArmor[] armors = new InfoArmor[_armorsInInventory.Count];
            _armorsInInventory.Values.CopyTo(armors, 0);
            InfoArmorDatabase iad = new InfoArmorDatabase();

            foreach (InfoArmor ia in armors)
            {
                iad.Database.Add(ia);
            }
            return(iad);
        }
Exemplo n.º 4
0
        public void LoadDefaultData()
        {
            string pathDSF          = ControlManager.Instance.PathToDefaultSaveValue;
            InfoWeaponsDatabase iwd = _infoWeaponsXMLManager.LoadInfoWeaponsDatabaseXML(pathDSF);

            InventoryManager.Instance.SetInventoryWeapons(iwd.DataBase);
            InfoArmorDatabase iad = _infoArmorXMLManager.LoadInfoArmorDatabaseXML(pathDSF);

            InventoryManager.Instance.SetInventoryArmor(iad.Database);
            InfoPlayer ip = _infoPlayerXMLManager.LoadInfoPlayerXML(pathDSF);

            StatsManager.Instance.InfoPlayer = ip;
        }
Exemplo n.º 5
0
        public void LoadAllData()
        {
            string pathSG           = ControlManager.Instance.PathToSaveGame;
            InfoWeaponsDatabase iwd = _infoWeaponsXMLManager.LoadInfoWeaponsDatabaseXML(pathSG);

            InventoryManager.Instance.SetInventoryWeapons(iwd.DataBase);
            InfoArmorDatabase iad = _infoArmorXMLManager.LoadInfoArmorDatabaseXML(pathSG);

            InventoryManager.Instance.SetInventoryArmor(iad.Database);
            InfoItemsDatabase iim = _infoItemsXMLManager.LoadInfoItemsDatabaseXML(pathSG);

            InventoryManager.Instance.SetInventoryItems(iim.DataBase);
            InfoPlayer ip = _infoPlayerXMLManager.LoadInfoPlayerXML(pathSG);

            StatsManager.Instance.InfoPlayer = ip;
        }
Exemplo n.º 6
0
 public void SaveArmorDatabaseIntoXML(InfoArmorDatabase armorToSave)
 {
     _infoArmorXMLManager.CreateInfoArmorDatabaseXML(armorToSave, ControlManager.Instance.PathToSaveGame);
 }