aboutsummaryrefslogtreecommitdiff
path: root/internal/game/validate_source.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/validate_source.go')
-rw-r--r--internal/game/validate_source.go53
1 files changed, 0 insertions, 53 deletions
diff --git a/internal/game/validate_source.go b/internal/game/validate_source.go
deleted file mode 100644
index 4a2e5b9..0000000
--- a/internal/game/validate_source.go
+++ /dev/null
@@ -1,53 +0,0 @@
-package game
-
-import (
- "thehouseoficarus/internal/validate"
-)
-
-// ValidateAndLog runs all startup integrity checks and logs the results.
-func (g *Game) ValidateAndLog() {
- validate.LogIssues(validate.Run(g.validationSource()))
-}
-
-// validationSource assembles the read-only view of all data stores that the
-// validate package needs, including the game-defined tech and course tables.
-func (g *Game) validationSource() validate.Source {
- courses := g.CourseStore.AllCourses()
- courseViews := make([]validate.CourseView, 0, len(courses))
- for id, cfg := range courses {
- rooms := make([]int, 0, len(cfg.Obstacles))
- for _, obs := range cfg.Obstacles {
- rooms = append(rooms, obs.RoomID)
- }
- courseViews = append(courseViews, validate.CourseView{
- ID: id,
- StartRoom: cfg.StartRoom,
- ObstacleRooms: rooms,
- })
- }
-
- techViews := make([]validate.TechView, 0, len(AllTechs))
- techIDs := make(map[string]bool, len(AllTechs))
- for _, t := range AllTechs {
- techViews = append(techViews, validate.TechView{
- ID: t.ID,
- Name: t.Name,
- Category: t.Category,
- DrainRate: t.DrainRate,
- })
- techIDs[t.ID] = true
- }
-
- return validate.Source{
- DataDir: g.DataDir,
- Items: g.ItemStore,
- Objects: g.ObjectStore,
- Mobs: g.MobStore,
- World: g.World,
- Courses: courseViews,
- Techs: techViews,
- TechIDs: techIDs,
- RootRooms: g.ValidationConfig.RootRooms,
- IgnoreUnreachable: g.ValidationConfig.IgnoreUnreachable,
- }
-}