-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathEquipmentSettings.cs
97 lines (88 loc) · 2.88 KB
/
EquipmentSettings.cs
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
using InteractiveSeven.Core.Data;
using InteractiveSeven.Core.Data.Items;
using System;
using System.Collections.Generic;
using System.Linq;
namespace InteractiveSeven.Core.Settings
{
public class EquipmentSettings : ObservableSettingsBase
{
private bool _enabled = true;
private bool _allowModOverride = true;
private bool _keepPreviousEquipment = true;
private bool _enablePauperCommand = true;
private int _pauperCommandCost = 20000;
public EquipmentSettings()
{
AllWeapons = Items.All.OfType<Weapon>().Select(x => new EquippableSettings(x, true, x.Words)).ToList();
AllArmlets = Items.All.OfType<Armlet>().Select(x => new EquippableSettings(x, true, x.Words)).ToList();
AllAccessories = Items.All.OfType<Accessory>().Select(x => new EquippableSettings(x, true, x.Words)).ToList();
}
public bool Enabled
{
get => _enabled;
set
{
_enabled = value;
OnPropertyChanged();
}
}
public bool AllowModOverride
{
get => _allowModOverride;
set
{
_allowModOverride = value;
OnPropertyChanged();
}
}
public bool KeepPreviousEquipment
{
get => _keepPreviousEquipment;
set
{
_keepPreviousEquipment = value;
OnPropertyChanged();
}
}
public bool EnablePauperCommand
{
get => _enablePauperCommand;
set
{
_enablePauperCommand = value;
OnPropertyChanged();
}
}
public int PauperCommandCost
{
get => _pauperCommandCost;
set
{
_pauperCommandCost = value;
OnPropertyChanged();
}
}
public List<EquippableSettings> AllByName(string name, CharNames charName, Type type)
{
if (type == typeof(Weapon))
{
return AllWeapons.AllByName(name, charName);
}
if (type == typeof(Accessory))
{
return AllAccessories.AllByName(name, charName);
}
if (type == typeof(Armlet))
{
return AllArmlets.AllByName(name, charName);
}
return new List<EquippableSettings>();
}
public List<EquippableSettings> AllWeapons { get; set; }
public List<EquippableSettings> AllArmlets { get; set; }
public List<EquippableSettings> AllAccessories { get; set; }
public PlayerGilSettings PlayerGilSettings { get; set; } = new PlayerGilSettings();
public PlayerGpSettings PlayerGpSettings { get; set; } = new PlayerGpSettings();
}
}