-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSettings.cs
More file actions
39 lines (36 loc) · 1.3 KB
/
Copy pathSettings.cs
File metadata and controls
39 lines (36 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Collections.Generic;
namespace PSO2ModManager
{
public class Settings
{
public string PSO2Dir { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public List<Mod> AvailableMods { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public List<Mod> InstalledMods { get; set; }
public static readonly string SettingsPath = AppDomain.CurrentDomain.BaseDirectory + "\\" + "settings.json";
/// <summary>
/// Checks if the updates file isn't damaged
/// </summary>
public bool IsValid() {
if (AvailableMods == null || InstalledMods == null || PSO2Dir == null) {
return false;
}
if (Helpers.ValidatePSO2Dir(PSO2Dir) == false) {
return false;
}
foreach (var m in AvailableMods) {
if (!m.IsValid()) {
return false;
}
}
foreach (var m in InstalledMods) {
if (!m.IsValid()) {
return false;
}
}
return true;
}
}
}