Add anatomical character customization at initial creation
This commit is contained in:
@@ -23,3 +23,29 @@ func TestAppearanceValidation(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestHumanoidAppearanceBounds(t *testing.T) {
|
||||
base := DefaultCharacterAppearance()
|
||||
if err := ValidateAppearance(base, "human"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, mutate := range []func(*Appearance){
|
||||
func(a *Appearance) { a.Body.HeadWidth = math.NaN() },
|
||||
func(a *Appearance) { a.Body.LegLength = 1.2 },
|
||||
func(a *Appearance) { a.Body.NoseHeight = .1 },
|
||||
func(a *Appearance) { a.Body.EyeColor = "red" },
|
||||
func(a *Appearance) { a.Body.Eyebrows = "unknown" },
|
||||
func(a *Appearance) { a.Body.Chest = "unknown" },
|
||||
func(a *Appearance) { a.Body.MouthStyle = "unknown" },
|
||||
func(a *Appearance) { a.Family = "creature" },
|
||||
func(a *Appearance) { a.Width = 1.1 },
|
||||
func(a *Appearance) { a.Body = nil },
|
||||
func(a *Appearance) { a.Version = 1 },
|
||||
} {
|
||||
a := DefaultCharacterAppearance()
|
||||
mutate(a)
|
||||
if ValidateAppearance(a, "human", "creature") == nil {
|
||||
t.Fatal("invalid anatomy accepted", a)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user