feat: dungeon generation — BSP rooms, room types, fog of war
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
27
dungeon/fov.go
Normal file
27
dungeon/fov.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package dungeon
|
||||
|
||||
type Visibility int
|
||||
|
||||
const (
|
||||
Hidden Visibility = iota
|
||||
Visited
|
||||
Visible
|
||||
)
|
||||
|
||||
func UpdateVisibility(floor *Floor) {
|
||||
for i, room := range floor.Rooms {
|
||||
if i == floor.CurrentRoom {
|
||||
room.Visited = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func GetRoomVisibility(floor *Floor, roomIdx int) Visibility {
|
||||
if roomIdx == floor.CurrentRoom {
|
||||
return Visible
|
||||
}
|
||||
if floor.Rooms[roomIdx].Visited {
|
||||
return Visited
|
||||
}
|
||||
return Hidden
|
||||
}
|
||||
Reference in New Issue
Block a user