This commit is contained in:
2023-07-03 15:48:01 +02:00
parent 663f578c7e
commit f5902947f8
9 changed files with 149 additions and 83 deletions

View File

@@ -10,7 +10,6 @@ type ContextInterface interface {
}
type DomainInterface interface {
GetMenuMap() MenuMap
Init()
}
@@ -19,6 +18,15 @@ type ScreenSettings struct {
Height int
}
type KContextScreen struct {
Type string
Value string
}
type KContext struct {
Screen KContextScreen
}
type Settings struct {
Name string
Screen *ScreenSettings
@@ -28,17 +36,20 @@ type Konstructor struct {
Domain DomainInterface
Controller *Controller
Settings *Settings
KContext *KContext
MenuMap MenuMap
}
func (k Konstructor) Init() {
k.Domain.Init()
ebiten.SetWindowSize(k.Settings.Screen.Width, k.Settings.Screen.Height)
ebiten.SetWindowTitle(k.Settings.Name)
if err := ebiten.RunGame(&Engine{
Logic: &Logic{
Domain: k.Domain,
Controller: k.Controller,
Settings: k.Settings,
},
MenuMap: k.MenuMap,
KContext: k.KContext,
Domain: k.Domain,
Controller: k.Controller,
Settings: k.Settings,
}); err != nil {
log.Fatal(err)
}