1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-19 02:46:35 -05:00
OpenDiablo2/Scenes/MapEngineTest.go

55 lines
1.3 KiB
Go

package Scenes
import (
"github.com/essial/OpenDiablo2/Common"
"github.com/essial/OpenDiablo2/Map"
"github.com/essial/OpenDiablo2/Sound"
"github.com/essial/OpenDiablo2/UI"
"github.com/hajimehoshi/ebiten"
)
type MapEngineTest struct {
uiManager *UI.Manager
soundManager *Sound.Manager
fileProvider Common.FileProvider
sceneProvider SceneProvider
//region *Map.Region
gameState *Common.GameState
mapEngine *Map.Engine
}
func CreateMapEngineTest(fileProvider Common.FileProvider, sceneProvider SceneProvider, uiManager *UI.Manager, soundManager *Sound.Manager) *MapEngineTest {
result := &MapEngineTest{
fileProvider: fileProvider,
uiManager: uiManager,
soundManager: soundManager,
sceneProvider: sceneProvider,
}
result.gameState = Common.CreateGameState()
return result
}
func (v *MapEngineTest) Load() []func() {
// TODO: Game seed comes from the game state object
v.soundManager.PlayBGM("")
return []func(){
func() {
v.mapEngine = Map.CreateMapEngine(v.gameState, v.soundManager, v.fileProvider)
v.mapEngine.GenerateMap(Map.RegionAct1Tristram, 300)
},
}
}
func (v *MapEngineTest) Unload() {
}
func (v *MapEngineTest) Render(screen *ebiten.Image) {
v.mapEngine.Render(screen)
}
func (v *MapEngineTest) Update(tickTime float64) {
}