Пример #1
0
        public SimplerSaveSlot(
            SaveFolder saveFolder,
            [NotNull] string nickname,
            SaveManagerSettings?settings = default
            )
        {
            if (string.IsNullOrWhiteSpace(nickname))
            {
                throw new ArgumentException("Value cannot be null or whitespace.", nameof(nickname));
            }

            SaveFolder = saveFolder;
            Nickname   = nickname;
            Settings   = settings ?? new SaveManagerSettings();
        }
Пример #2
0
 public ISaveFile <TData> Load(SaveManagerSettings saveSettings = default)
 {
     saveSettings ??= new SaveManagerSettings();
     Data = File.Deserialize <TData>(saveSettings.JsonSerializerSettings);
     return(this);
 }
Пример #3
0
 public ISaveFile <TData> Save(SaveManagerSettings saveSettings = default)
 {
     saveSettings ??= new SaveManagerSettings();
     Save(saveSettings.DuplicateFileResolution, saveSettings.JsonSerializerSettings);
     return(this);
 }