adventure: draw the dungeon as a fog-of-war map, not a room tally
This commit is contained in:
@@ -33,6 +33,30 @@ type whoDetail struct {
|
||||
Supplies int `json:"supplies"`
|
||||
ThreatLevel int `json:"threat_level"`
|
||||
Room string `json:"room"`
|
||||
Map *whoMap `json:"map"`
|
||||
}
|
||||
|
||||
// whoMap is the fog-of-war zone graph as gogobee cut it: visited rooms with
|
||||
// their true kind, plus the one-hop frontier of doors whose rooms are withheld
|
||||
// (kind "unknown"). Pete lays it out and draws it; it never receives node
|
||||
// labels or contents, only ids and kinds. See who_map.go.
|
||||
type whoMap struct {
|
||||
ZoneID string `json:"zone_id"`
|
||||
CurrentNode string `json:"current_node"`
|
||||
Visited []string `json:"visited"`
|
||||
Nodes []whoMapNode `json:"nodes"`
|
||||
Edges []whoMapEdge `json:"edges"`
|
||||
}
|
||||
|
||||
type whoMapNode struct {
|
||||
ID string `json:"id"`
|
||||
Kind string `json:"kind"`
|
||||
}
|
||||
|
||||
type whoMapEdge struct {
|
||||
From string `json:"from"`
|
||||
To string `json:"to"`
|
||||
Lock string `json:"lock"`
|
||||
}
|
||||
|
||||
type whoGear struct {
|
||||
@@ -58,6 +82,7 @@ type whoPage struct {
|
||||
HasDetail bool
|
||||
Detail whoDetail
|
||||
Abilities []abilityRow
|
||||
MapView *mapView // laid-out dungeon map, nil when not on a run or no graph
|
||||
HasSelf bool
|
||||
Self storage.PlayerDetail
|
||||
// The private panels, wrapped so a row knows where it is sitting. Bond state
|
||||
@@ -150,6 +175,7 @@ func (s *Server) handleAdventureWho(w http.ResponseWriter, r *http.Request) {
|
||||
page.HasDetail = true
|
||||
page.Detail = d
|
||||
page.Abilities = abil
|
||||
page.MapView = buildMapView(d.Map)
|
||||
}
|
||||
|
||||
// History: one read feeds both the trophy case and the trail. Keyed on the
|
||||
|
||||
Reference in New Issue
Block a user