PurchasableMap
A class in Root.Township, Alta.Customization.
Global settings asset mapping shop items: store SKUs to hashes, set contents, item categories and which hashes are cosmetics. Get it with GlobalSettings<PurchasableMap>.Instance.
- Listed in Customization and screenshots
- Inherits or implements
GlobalSettings<PurchasableMap> - Derived types
PurchasableMap - Nested types
CosmeticCategory,CosmeticSet,HashIdentifierPair - Attributes
GlobalSettings,CreateAssetMenu
Constructors
| Member | What it is |
|---|---|
PurchasableMap() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
11 private and internal fields
| Member | What it is |
|---|---|
private string[] allItems | Backing field for AllItems. |
private PurchasableMap.CosmeticCategory[] categories | Serialized category to item list. |
private Dictionary<uint, ICustomizationCategory> categoryMap | Lookup built from categories on first use. |
private uint[] cosmeticDefinitions | Serialized hashes of cosmetic definitions. |
private uint[] devItems | Backing field for DevItems. |
private PurchasableMap.HashIdentifierPair[] hashIdentifierPairs | Serialized SKU to hash pairs. |
private static Logger logger | NLog logger for this class. |
private HashSet<uint> mappedCosmeticDefinitions | Set built from cosmeticDefinitions on first use. |
private Dictionary<string, uint> mappedHashIdentifierPair | Lookup built from hashIdentifierPairs on first use. |
private Dictionary<uint, uint[]> mappedSets | Lookup built from sets on first use. |
private PurchasableMap.CosmeticSet[] sets | Serialized cosmetic sets and their items. |
Properties
| Member | What it is |
|---|---|
string[] AllItems { get; } | Addressable keys of every purchasable; Purchasable loads them all at startup. |
uint[] DevItems { get; } | Item hashes that PurchasedList marks as owned for players with Developer status. |
Methods
| Member | What it is |
|---|---|
uint ConvertStoreSKUToHash(string storeSKU) | Returns the item hash for a store SKU. Throws if the SKU isn't mapped. |
PlayerCosmeticCategory GetItemCategory(uint itemHash) | Returns the cosmetic category for an item hash, or null. |
bool GetSetContent(uint hash, out uint[] content) | Gets the item hashes in a set; false if the hash isn't a set. |
bool IsCosmeticDefinition(uint hash) | Whether a hash is a cosmetic definition (as opposed to a set or other purchasable). |