示例#1
0
    public void Save()
    {
        try
        {
            EnsureProfileDirectory();

            NewJSON jsonStructure = new NewJSON()
            {
                DisabledList = new List <string>(DisabledList), Operation = Operation
            };

            if (Operation == SetOperation.Expert)
            {
                // Update the EnabledList based on currently installed mods.
                if (EnabledList == null)
                {
                    EnabledList = new HashSet <string>();
                }
                foreach (string name in ModSelectorService.Instance._allExpertMods)
                {
                    if (DisabledList.Contains(name))
                    {
                        EnabledList.Remove(name);
                    }
                    else
                    {
                        EnabledList.Add(name);
                    }
                }
                jsonStructure.EnabledList = new List <string>(EnabledList);
            }

            string jsonOutput = JsonConvert.SerializeObject(jsonStructure, Formatting.Indented);
            File.WriteAllText(FullPath, jsonOutput);
        }
        catch (Exception ex)
        {
            Debug.LogException(ex);
        }
    }
示例#2
0
 public ChrononPlasma()
 {
     _enabledParticles = new EnabledList <IChronon>();
 }