remove Game prefix from Settings struct
This commit is contained in:
@@ -22,5 +22,5 @@ func (g *GameEngine) Draw(screen *ebiten.Image) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (g *GameEngine) Layout(outsideWidth, outsideHeight int) (int, int) {
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,21 +18,21 @@ type ScreenSettings struct {
|
|||||||
Height int
|
Height int
|
||||||
}
|
}
|
||||||
|
|
||||||
type GameSettings struct {
|
type Settings struct {
|
||||||
Name string
|
Name string
|
||||||
ScreenSettings ScreenSettings
|
Screen ScreenSettings
|
||||||
}
|
}
|
||||||
|
|
||||||
type Konstructor struct {
|
type Konstructor struct {
|
||||||
Context ContextInterface
|
Context ContextInterface
|
||||||
Domain DomainInterface
|
Domain DomainInterface
|
||||||
Controller Controller
|
Controller Controller
|
||||||
GameSettings GameSettings
|
Settings Settings
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k Konstructor) Init() {
|
func (k Konstructor) Init() {
|
||||||
ebiten.SetWindowSize(k.GameSettings.ScreenSettings.Width, k.GameSettings.ScreenSettings.Height)
|
ebiten.SetWindowSize(k.Settings.Screen.Width, k.Settings.Screen.Height)
|
||||||
ebiten.SetWindowTitle(k.GameSettings.Name)
|
ebiten.SetWindowTitle(k.Settings.Name)
|
||||||
if err := ebiten.RunGame(&GameEngine{
|
if err := ebiten.RunGame(&GameEngine{
|
||||||
Konstructor: k,
|
Konstructor: k,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
|
|||||||
4
main.go
4
main.go
@@ -32,9 +32,9 @@ func main() {
|
|||||||
Action3: ebiten.KeyEscape,
|
Action3: ebiten.KeyEscape,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
GameSettings: konstructor.GameSettings{
|
Settings: konstructor.Settings{
|
||||||
Name: "Game",
|
Name: "Game",
|
||||||
ScreenSettings: konstructor.ScreenSettings{
|
Screen: konstructor.ScreenSettings{
|
||||||
Width: 640,
|
Width: 640,
|
||||||
Height: 480,
|
Height: 480,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user