Add persistent destructible world structures and building kits
This commit is contained in:
@@ -49,6 +49,7 @@ type ItemDefinition struct {
|
||||
Modifiers []StatModifier `json:"modifiers" yaml:"modifiers"`
|
||||
}
|
||||
type Catalog struct {
|
||||
Building *BuildingContent `json:"building,omitempty"`
|
||||
Powers *PowerContent `json:"powers,omitempty"`
|
||||
Crafting *CraftingContent `json:"crafting,omitempty"`
|
||||
Combat *CombatContent `json:"combat,omitempty"`
|
||||
@@ -134,6 +135,9 @@ func (item ItemDefinition) Validate() error {
|
||||
return ValidateModifiers(item.Modifiers)
|
||||
}
|
||||
func (c Catalog) Validate() error {
|
||||
if e := c.validateBuilding(); e != nil {
|
||||
return e
|
||||
}
|
||||
if err := c.validatePowers(); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -215,5 +219,5 @@ func DefaultCatalog() (Catalog, error) {
|
||||
if err != nil {
|
||||
return Catalog{}, err
|
||||
}
|
||||
return Catalog{Powers: b.Powers, Crafting: b.Crafting, Combat: b.Combat, Gathering: b.Gathering, Version: 1, Titles: b.Titles, Items: b.Items, Stats: *b.Stats}, nil
|
||||
return Catalog{Building: b.Building, Powers: b.Powers, Crafting: b.Crafting, Combat: b.Combat, Gathering: b.Gathering, Version: 1, Titles: b.Titles, Items: b.Items, Stats: *b.Stats}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user