EngineWrapper, engine via interfaces
This commit is contained in:
@@ -1,33 +1,22 @@
|
||||
package konstructor
|
||||
|
||||
import (
|
||||
"game/konstructor/engine"
|
||||
"game/konstructor/entity"
|
||||
|
||||
"github.com/hajimehoshi/ebiten"
|
||||
)
|
||||
|
||||
type Konstructor struct {
|
||||
Domain entity.DomainInterface
|
||||
Settings *entity.Settings
|
||||
KContext *entity.KContext
|
||||
Domain entity.DomainInterface
|
||||
Settings entity.Settings
|
||||
KContext *entity.KContext
|
||||
EngineWrapper entity.EngineWrapperInterface
|
||||
}
|
||||
|
||||
func (k Konstructor) Init() {
|
||||
k.Domain.Init()
|
||||
k.SetWindow()
|
||||
k.Run()
|
||||
}
|
||||
|
||||
func (k Konstructor) SetWindow() {
|
||||
ebiten.SetWindowSize(k.Settings.Screen.Width, k.Settings.Screen.Height)
|
||||
ebiten.SetWindowTitle(k.Settings.Name)
|
||||
}
|
||||
|
||||
func (k Konstructor) Run() {
|
||||
ebiten.RunGame(&engine.Engine{
|
||||
KContext: k.KContext,
|
||||
k.EngineWrapper.Init(entity.EngineOptions{
|
||||
KContext: *k.KContext,
|
||||
Domain: k.Domain,
|
||||
Settings: k.Settings,
|
||||
})
|
||||
k.EngineWrapper.Run()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user