From 470bc5bd99b793e46305310b5fbeb3068eba45f1 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Sat, 20 Jun 2026 23:43:35 -0400 Subject: refactor: removed separate crafting recipes and combined them into item YAML --- internal/game/game.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'internal/game/game.go') diff --git a/internal/game/game.go b/internal/game/game.go index ac8622e..0dd5bdc 100644 --- a/internal/game/game.go +++ b/internal/game/game.go @@ -7,7 +7,6 @@ import ( "sync" "time" - "thehouseoficarus/internal/action" "thehouseoficarus/internal/combat" "thehouseoficarus/internal/config" "thehouseoficarus/internal/engine" @@ -40,7 +39,7 @@ type Game struct { ItemStore *object.ItemStore AccountStore *player.AccountStore MobStore *world.MobStore - RecipeStore *action.RecipeStore + CraftIndex *CraftIndex CourseStore *CourseStore Hub *net.Hub Ticks *engine.Engine @@ -67,7 +66,7 @@ func New(dataDir string, colorConfig *config.ColorsConfig, valConfig config.Vali ItemStore: object.NewItemStore(dataDir), AccountStore: player.NewAccountStore(dataDir), MobStore: world.NewMobStore(dataDir), - RecipeStore: action.NewRecipeStore(dataDir), + CraftIndex: NewCraftIndex(), CourseStore: NewCourseStore(dataDir), Ticks: engine.New(), WorldFlags: make(map[string]any), @@ -85,6 +84,7 @@ func New(dataDir string, colorConfig *config.ColorsConfig, valConfig config.Vali } g.CourseStore.LoadAll() g.LoadMods() + g.buildCraftIndex() g.ValidateAndLog() return g } @@ -331,6 +331,14 @@ func (g *Game) ProcessQueuedCommands() { g.flushPendingDepletions() } +func (g *Game) buildCraftIndex() { + items, err := g.ItemStore.LoadAll() + if err != nil { + return + } + g.CraftIndex.Build(items) +} + type pendingDepletion struct { instanceKey string objDefID string -- cgit v1.2.3