Declare the managers in boot.go, hand them to the engine whole
ci/woodpecker/push/ebitengine Pipeline was successful

boot.manager.go becomes boot.go and carries all seven managers as one
block, so what the game holds reads in one place instead of a line hidden
in each category file. The category files keep their entity alias.

The hand-off stops copying. Our managers are the same *inkwell.Manager[T]
the Game holds, so New assigns them onto it and engine and game share one
registry per category. content.manager.go is gone with the copy loop.

Themes stay additive — NewGame seeds four presets we would otherwise
throw away — and registerScene becomes prepareScene, which now has to run
before the hand-off: with no copy pass left, the scene defaults are
written back into SceneManager with Set.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-30 10:37:02 +02:00
co-authored by Claude Opus 5
parent a70dff8771
commit 220985ec57
13 changed files with 96 additions and 78 deletions
-2
View File
@@ -5,5 +5,3 @@ import (
)
type Background = inkwell.Asset
var BackgroundManager = inkwell.NewManager[Background]()
+20 -3
View File
@@ -4,6 +4,16 @@ import (
inkwell "git.teletypegames.org/engines/inkwell"
)
var (
BackgroundManager = inkwell.NewManager[Background]()
CharacterManager = inkwell.NewManager[Character]()
DialogManager = inkwell.NewManager[Dialog]()
ItemManager = inkwell.NewManager[Item]()
SceneManager = inkwell.NewManager[Scene]()
ScriptManager = inkwell.NewManager[Script]()
ThemeManager = inkwell.NewManager[Theme]()
)
type Opts struct {
Scene string
Finale bool
@@ -15,6 +25,8 @@ func New(o Opts) *inkwell.Game {
start = SceneAlley
}
prepareScene()
g := inkwell.NewGame("Real World", ScreenW, ScreenH)
g.MaxLogLines = 64
g.SceneRect = inkwell.Rect(0, TopBarH, ScreenW, HUDTop-TopBarH)
@@ -25,10 +37,15 @@ func New(o Opts) *inkwell.Game {
return inkwell.Say(Paul, "It's a way out, not a thing.")
}
World.attach(g)
registerTheme()
registerContent()
g.AssetManager = BackgroundManager
g.CharacterManager = CharacterManager
g.DialogueManager = DialogManager
g.ItemManager = ItemManager
g.SceneManager = SceneManager
g.ScriptManager = ScriptManager
ThemeManager.Each(g.ThemeManager.Register)
World.attach(g)
g.UseTheme(RealWorld)
registerUI()
-2
View File
@@ -5,5 +5,3 @@ import (
)
type Character = inkwell.Character
var CharacterManager = inkwell.NewManager[Character]()
-10
View File
@@ -1,10 +0,0 @@
package inc
func registerContent() {
BackgroundManager.Each(World.G.AssetManager.Register)
CharacterManager.Each(World.G.CharacterManager.Register)
ItemManager.Each(World.G.ItemManager.Register)
DialogManager.Each(World.G.DialogueManager.Register)
ScriptManager.Each(World.G.ScriptManager.Register)
registerScene()
}
-2
View File
@@ -5,5 +5,3 @@ import (
)
type Dialog = inkwell.Dialogue
var DialogManager = inkwell.NewManager[Dialog]()
-2
View File
@@ -5,5 +5,3 @@ import (
)
type Item = inkwell.Item
var ItemManager = inkwell.NewManager[Item]()
+4 -6
View File
@@ -6,13 +6,11 @@ import (
type Scene = inkwell.Scene
var SceneManager = inkwell.NewManager[Scene]()
func registerScene() {
func prepareScene() {
fillSelectorPins()
SceneManager.Each(func(entity Scene) {
World.G.SceneManager.Register(sceneDefaults(entity))
})
for _, entity := range SceneManager.All() {
SceneManager.Set(sceneDefaults(entity))
}
}
var sceneFloor = []inkwell.Polygon{
-2
View File
@@ -5,5 +5,3 @@ import (
)
type Script = inkwell.Script
var ScriptManager = inkwell.NewManager[Script]()
-6
View File
@@ -8,8 +8,6 @@ import (
type Theme = inkwell.Theme
var ThemeManager = inkwell.NewManager[Theme]()
const (
RealWorld = "realworld-93"
NokiaPunk = "nokia-punk"
@@ -32,7 +30,3 @@ func RGBA(hex uint32, a uint8) color.Color {
A: a,
}
}
func registerTheme() {
ThemeManager.Each(World.G.ThemeManager.Register)
}