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.

50 lines
988 B
Go

package main
import (
"flag"
"log"
// "github.com/goccy/go-graphviz"
_ "github.com/mattn/go-sqlite3"
)
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)
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
}
}