2024-05-06 18:59:14 +03:00
|
|
|
package world
|
|
|
|
|
|
|
|
import (
|
2024-05-06 21:19:08 +03:00
|
|
|
"mvvasilev/last_light/engine"
|
2024-05-06 18:59:14 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
type BSPDungeonMap struct {
|
|
|
|
level *BasicMap
|
|
|
|
|
2024-05-12 23:22:39 +03:00
|
|
|
playerSpawnPoint engine.Position
|
|
|
|
nextLevelStaircase engine.Position
|
|
|
|
rooms []engine.BoundingBox
|
2024-05-06 18:59:14 +03:00
|
|
|
}
|
|
|
|
|
2024-05-06 21:19:08 +03:00
|
|
|
func (bsp *BSPDungeonMap) PlayerSpawnPoint() engine.Position {
|
2024-05-06 18:59:14 +03:00
|
|
|
return bsp.playerSpawnPoint
|
|
|
|
}
|
|
|
|
|
2024-05-12 23:22:39 +03:00
|
|
|
func (bsp *BSPDungeonMap) NextLevelStaircasePosition() engine.Position {
|
|
|
|
return bsp.nextLevelStaircase
|
|
|
|
}
|
|
|
|
|
2024-05-06 21:19:08 +03:00
|
|
|
func (bsp *BSPDungeonMap) Size() engine.Size {
|
2024-05-06 18:59:14 +03:00
|
|
|
return bsp.level.Size()
|
|
|
|
}
|
|
|
|
|
2024-05-12 23:22:39 +03:00
|
|
|
func (bsp *BSPDungeonMap) SetTileAt(x int, y int, t Tile) Tile {
|
|
|
|
return bsp.level.SetTileAt(x, y, t)
|
2024-05-06 18:59:14 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (bsp *BSPDungeonMap) TileAt(x int, y int) Tile {
|
|
|
|
return bsp.level.TileAt(x, y)
|
|
|
|
}
|
|
|
|
|
2024-05-21 23:08:51 +03:00
|
|
|
func (bsp *BSPDungeonMap) IsInBounds(x, y int) bool {
|
|
|
|
return bsp.level.IsInBounds(x, y)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (bsp *BSPDungeonMap) ExploredTileAt(x, y int) Tile {
|
|
|
|
return bsp.level.ExploredTileAt(x, y)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (bsp *BSPDungeonMap) MarkExplored(x, y int) {
|
|
|
|
bsp.level.MarkExplored(x, y)
|
|
|
|
}
|
|
|
|
|
2024-05-06 18:59:14 +03:00
|
|
|
func (bsp *BSPDungeonMap) Tick(dt int64) {
|
|
|
|
}
|
|
|
|
|
2024-05-06 21:19:08 +03:00
|
|
|
func (bsp *BSPDungeonMap) Rooms() []engine.BoundingBox {
|
2024-05-06 18:59:14 +03:00
|
|
|
return bsp.rooms
|
|
|
|
}
|
2024-05-12 23:22:39 +03:00
|
|
|
|
|
|
|
func (bsp *BSPDungeonMap) PreviousLevelStaircasePosition() engine.Position {
|
|
|
|
return bsp.playerSpawnPoint
|
|
|
|
}
|