Move scene shape facts into the scene family
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/dnd"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/codec/candidatejson"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/codec/sourcerange"
|
||||
scenefacts "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/scenedescriptions"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -91,7 +92,7 @@ func validate(value dnd.SceneDescriptionList) error {
|
||||
if strings.TrimSpace(scene.ID) == "" {
|
||||
return fmt.Errorf("%s.id must not be empty", prefix)
|
||||
}
|
||||
if !validSceneKind(scene.Kind) {
|
||||
if !scenefacts.ValidKind(scene.Kind) {
|
||||
return fmt.Errorf("%s.kind must be supported", prefix)
|
||||
}
|
||||
if strings.TrimSpace(scene.Title) == "" {
|
||||
@@ -109,12 +110,3 @@ func validate(value dnd.SceneDescriptionList) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func validSceneKind(value dnd.SceneKind) bool {
|
||||
switch value {
|
||||
case dnd.SceneKindCombat, dnd.SceneKindNarrative, dnd.SceneKindRecap, dnd.SceneKindMeta:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user