Exemple #1
0
        public CampaignData SaveNewCampaign()
        {
            var newData = new CampaignData(CurrentCampaignSequence.campaignName, CurrentCampaignIndex, FarthestCampaignIndex, CurrentCampaignIsCompleted, CampaignPlayerData);

            CampaignDataSlots.Add(newData);

            CampaignDataFileHandler.SaveCampaignData(newData);

            return(newData);
        }
Exemple #2
0
        public CampaignData SaveCampaign(CampaignData data)
        {
            // Overwrite existing data
            CampaignDataFileHandler.DeleteCampaignData(data);

            data.CampaignName          = CurrentCampaignSequence.campaignName;
            data.CurrentCampaignIndex  = CurrentCampaignIndex;
            data.FarthestCampaignIndex = FarthestCampaignIndex;
            data.IsCompleted           = CurrentCampaignIsCompleted;
            data.PlayerData            = CampaignPlayerData;
            data.Difficulty            = CurrentCampaignDifficulty;
            data.UnitWrapperData       = CampaignPlayerData.CampaignUnits.Select(unit => new UnitWrapper(unit)).ToList();
            data.WeaponWrapperData     = CampaignPlayerData.Weapons.Select(weapon => new WeaponWrapper(weapon)).ToList();
            data.ItemWrapperData       = CampaignPlayerData.Items.Select(item => new ItemWrapper(item)).ToList();

            CampaignDataFileHandler.SaveCampaignData(data);

            CurrentCampaignSaved = true;
            return(data);
        }