DatabaseService and other fixes

This commit is contained in:
Alex
2025-01-07 10:45:40 +00:00
parent 3fcf9a0657
commit ffd3712ce5
6 changed files with 509 additions and 13 deletions
+18
View File
@@ -63,4 +63,22 @@ public class Locations
/** Holds a mapping of the linkages between locations on the UI */
[JsonPropertyName("base")]
public LocationsBase? Base { get; set; }
public Eft.Common.Location? this[string key]
{
get
{
return (Eft.Common.Location?) GetType()
.GetProperties()
.First(p => p.Name.ToLower() == key.ToLower()).GetGetMethod()?
.Invoke(this, null) ?? null;
}
set
{
GetType()
.GetProperties()
.First(p => p.Name.ToLower() == key.ToLower()).GetSetMethod()?
.Invoke(this, [value]);
}
}
}
+1 -1
View File
@@ -37,7 +37,7 @@ public class Templates
/** Flea prices of items - gathered from online flea market dump */
[JsonPropertyName("prices")]
public Dictionary<string, decimal> Prices { get; set; }
public Dictionary<string, double> Prices { get; set; }
/** Default equipment loadouts that show on main inventory screen */
[JsonPropertyName("defaultEquipmentPresets")]