remove Game prefix from Settings struct

This commit is contained in:
2023-06-30 18:18:01 +02:00
parent c07074aeb9
commit d5482dd9e7
3 changed files with 12 additions and 12 deletions

View File

@@ -22,5 +22,5 @@ func (g *GameEngine) Draw(screen *ebiten.Image) {
}
func (g *GameEngine) Layout(outsideWidth, outsideHeight int) (int, int) {
return g.Konstructor.GameSettings.ScreenSettings.Width, g.Konstructor.GameSettings.ScreenSettings.Height
return g.Konstructor.Settings.Screen.Width, g.Konstructor.Settings.Screen.Height
}

View File

@@ -18,21 +18,21 @@ type ScreenSettings struct {
Height int
}
type GameSettings struct {
Name string
ScreenSettings ScreenSettings
type Settings struct {
Name string
Screen ScreenSettings
}
type Konstructor struct {
Context ContextInterface
Domain DomainInterface
Controller Controller
GameSettings GameSettings
Context ContextInterface
Domain DomainInterface
Controller Controller
Settings Settings
}
func (k Konstructor) Init() {
ebiten.SetWindowSize(k.GameSettings.ScreenSettings.Width, k.GameSettings.ScreenSettings.Height)
ebiten.SetWindowTitle(k.GameSettings.Name)
ebiten.SetWindowSize(k.Settings.Screen.Width, k.Settings.Screen.Height)
ebiten.SetWindowTitle(k.Settings.Name)
if err := ebiten.RunGame(&GameEngine{
Konstructor: k,
}); err != nil {

View File

@@ -32,9 +32,9 @@ func main() {
Action3: ebiten.KeyEscape,
},
},
GameSettings: konstructor.GameSettings{
Settings: konstructor.Settings{
Name: "Game",
ScreenSettings: konstructor.ScreenSettings{
Screen: konstructor.ScreenSettings{
Width: 640,
Height: 480,
},