Add reusable content sets publication previews and focused input handling
This commit is contained in:
@@ -44,10 +44,12 @@ type ItemDefinition struct {
|
||||
Modifiers []StatModifier `json:"modifiers" yaml:"modifiers"`
|
||||
}
|
||||
type Catalog struct {
|
||||
Version int64 `json:"version"`
|
||||
Titles []Title `json:"titles"`
|
||||
Items []ItemDefinition `json:"items"`
|
||||
Stats StatsRules `json:"stats"`
|
||||
Version int64 `json:"version"`
|
||||
Titles []Title `json:"titles"`
|
||||
Items []ItemDefinition `json:"items"`
|
||||
Stats StatsRules `json:"stats"`
|
||||
RequirementSets []RequirementSet `json:"requirementSets,omitempty"`
|
||||
EffectSets []EffectSet `json:"effectSets,omitempty"`
|
||||
}
|
||||
|
||||
func KnownStat(stat string) bool {
|
||||
@@ -120,6 +122,9 @@ func (item ItemDefinition) Validate() error {
|
||||
return ValidateModifiers(item.Modifiers)
|
||||
}
|
||||
func (c Catalog) Validate() error {
|
||||
if err := c.validateLibrary(); err != nil {
|
||||
return err
|
||||
}
|
||||
if c.Version < 1 || len(c.Items) > 512 {
|
||||
return fmt.Errorf("invalid catalog version or item count")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user