You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.2 KiB
Go

2 years ago
package main
import (
"flag"
"log"
// "github.com/goccy/go-graphviz"
_ "github.com/mattn/go-sqlite3"
2 years ago
)
func main() {
// log.Println("entering main")
var (
mapDB string
)
flag.StringVar(&mapDB, "map", "Aardwolf.db", "name of aardwolf map file")
// log.Println("parsing flags?")
flag.Parse()
// log.Println("flags parsed")
am, err := NewMapper(mapDB)
if err != nil {
log.Fatalf("error creating AardMapper: %s\n", err)
}
log.Printf("databse opened: %#+v\n", am)
2 years ago
areas, err := am.Areas()
if err != nil {
log.Fatalf("error fetching Areas: %s\n", err)
}
log.Printf("found %d areas\n", len(areas))
for k, v := range areas {
log.Printf("found Area: %s\n", k)
log.Printf("%#+v\n", v)
break
}
rooms, err := am.Rooms()
if err != nil {
log.Fatalf("error fetching Rooms: %s\n", err)
}
log.Printf("found %d rooms\n", len(rooms))
for k, v := range rooms {
log.Printf("found Room: (%s,%s)[%s]\n", v.Name, v.Area, k)
log.Printf("%#+v\n", v)
break
}
// now that I have areas and rooms, I can start building a map
// first iteration should be a recursive walk
// step over every room. add a vertex, then descend into each
// adjoining room
2 years ago
}