sodoff/src/Services/StoreService.cs
Spirtix 0460746824 implement store, purchases; fix inventory
This only implements V2 purchases
V1 purchases are used outside of the store
2023-07-03 19:38:52 +02:00

22 lines
556 B
C#

using sodoff.Schema;
using sodoff.Util;
namespace sodoff.Services;
public class StoreService {
// NOTE: ANother memory waste (slow clap)
Dictionary<int, ItemsInStoreData> stores = new();
public StoreService() {
GetStoreResponse storeArray = XmlUtil.DeserializeXml<GetStoreResponse>(XmlUtil.ReadResourceXmlString("store"));
foreach (var s in storeArray.Stores)
if (s.ID != null)
stores.Add((int)s.ID, s);
}
public ItemsInStoreData GetStore(int id) {
return stores[id];
}
}