Add terrain biomes jumping and extensible gathering professions
This commit is contained in:
@@ -19,6 +19,8 @@ type Recipe struct {
|
||||
}
|
||||
|
||||
type Balance struct {
|
||||
Gathering *GatheringContent `yaml:"gathering"`
|
||||
GatheringRules *GatheringRules `yaml:"gatheringRules"`
|
||||
Version int `yaml:"version"`
|
||||
TickHz int `yaml:"tickHz"`
|
||||
SnapshotHz int `yaml:"snapshotHz"`
|
||||
@@ -76,6 +78,16 @@ func Parse(data []byte) (Balance, error) {
|
||||
return b, b.Validate()
|
||||
}
|
||||
func (b Balance) Validate() error {
|
||||
if b.Gathering != nil {
|
||||
if err := b.Gathering.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if b.GatheringRules != nil {
|
||||
if err := b.GatheringRules.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if b.Stats == nil {
|
||||
return fmt.Errorf("stats rules are required")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user