engine layer

This commit is contained in:
2023-07-04 23:32:17 +02:00
parent 386bee5cd4
commit 374f7a9acc
10 changed files with 23 additions and 23 deletions

View File

@@ -1,4 +1,4 @@
package konstructor
package engine
import (
"fmt"

View File

@@ -1,4 +1,4 @@
package konstructor
package engine
import (
"game/konstructor/entity"
@@ -8,7 +8,7 @@ import (
)
type Engine struct {
Domain DomainInterface
Domain entity.DomainInterface
Controller *Controller
Settings *entity.Settings
KContext *entity.KContext

View File

@@ -1,4 +1,4 @@
package konstructor
package engine
import (
"bytes"

View File

@@ -1,4 +1,4 @@
package konstructor
package engine
import (
"github.com/hajimehoshi/ebiten"

View File

@@ -1,4 +1,4 @@
package konstructor
package engine
import (
"github.com/hajimehoshi/ebiten"

View File

@@ -1,4 +1,4 @@
package konstructor
package engine
import (
"github.com/hajimehoshi/ebiten"

View File

@@ -0,0 +1,10 @@
package entity
type DomainInterface interface {
Init()
GetMenu(name string) Menu
SetMenu(name string, menu Menu)
GetDialog(name string) Dialog
SetDialog(name string, menu Dialog)
GetLevel(index int) Level
}

View File

@@ -1,26 +1,15 @@
package konstructor
import (
"game/konstructor/engine"
"game/konstructor/entity"
"github.com/hajimehoshi/ebiten"
)
type ContextInterface interface {
}
type DomainInterface interface {
Init()
GetMenu(name string) entity.Menu
SetMenu(name string, menu entity.Menu)
GetDialog(name string) entity.Dialog
SetDialog(name string, menu entity.Dialog)
GetLevel(index int) entity.Level
}
type Konstructor struct {
Domain DomainInterface
Controller *Controller
Domain entity.DomainInterface
Controller *engine.Controller
Settings *entity.Settings
KContext *entity.KContext
}
@@ -37,7 +26,7 @@ func (k Konstructor) SetWindow() {
}
func (k Konstructor) Run() {
ebiten.RunGame(&Engine{
ebiten.RunGame(&engine.Engine{
KContext: k.KContext,
Domain: k.Domain,
Controller: k.Controller,