diff --git a/definitions/07-Hiro-Inventory.json b/definitions/07-Hiro-Inventory.json index 68cb33a..101d88c 100644 --- a/definitions/07-Hiro-Inventory.json +++ b/definitions/07-Hiro-Inventory.json @@ -33,5 +33,10 @@ "prop2": 456 } } + }, + "limits": { + "categories": { + "category1": 10 + } } } diff --git a/inventory.go b/inventory.go index 479827a..130436f 100644 --- a/inventory.go +++ b/inventory.go @@ -22,6 +22,7 @@ import ( type InventoryConfig struct { Items map[string]*InventoryConfigItem `json:"items,omitempty"` + Limits *InventoryConfigLimits `json:"limits,omitempty"` ItemSets map[string]map[string]bool `json:"-"` // Auto-computed when the config is read or personalized. } @@ -40,6 +41,11 @@ type InventoryConfigItem struct { KeepZero bool `json:"keep_zero,omitempty"` } +type InventoryConfigLimits struct { + Categories map[string]int64 `json:"categories,omitempty"` + ItemSets map[string]int64 `json:"item_sets,omitempty"` +} + // The InventorySystem provides a gameplay system which can manage a player's inventory. // // A player can have items added via economy rewards, or directly. diff --git a/schemas/07-Hiro-Inventory.json b/schemas/07-Hiro-Inventory.json index 09833de..bd653ae 100644 --- a/schemas/07-Hiro-Inventory.json +++ b/schemas/07-Hiro-Inventory.json @@ -70,6 +70,29 @@ } }, "type": "object" + }, + "limits": { + "properties": { + "categories": { + "patternProperties": { + ".+": { + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "item_sets": { + "patternProperties": { + ".+": { + "minimum": 0, + "type": "number" + } + }, + "type": "object" + } + }, + "type": "object" } }, "type": "object"