// Load initializes the Beastiary map with creatures. func Load() (err error) { filenames, err := util.DirFiles("github.com/karlek/reason/creature/data/") if err != nil { return errutil.Err(err) } for _, filename := range filenames { c, err := load(filename) if err != nil { return errutil.Err(err) } Beastiary[c.Name()] = *c } return nil }
// Load initializes the fauna collection. func Load() (err error) { filenames, err := util.DirFiles("github.com/karlek/reason/terrain/data/") if err != nil { return errutil.Err(err) } for _, filename := range filenames { t, err := load(filename) if err != nil { return errutil.Err(err) } Fauna[t.Name()] = *t } return nil }
// Load initializes the objects collection. func Load() (err error) { filenames, err := util.DirFiles("github.com/karlek/reason/object/data/") if err != nil { return errutil.Err(err) } for _, filename := range filenames { o, err := load(filename) if err != nil { return errutil.Err(err) } log.Println("here!") Objects[o.Name()] = *o } return nil }
// Load initializes the Items map with creatures. func Load() (err error) { filenames, err := util.DirFiles("github.com/karlek/reason/item/data/") if err != nil { return errutil.Err(err) } for _, filename := range filenames { i, err := load(filename) if err != nil { return errutil.Err(err) } if i == nil { log.Println("asdf") continue } Items[i.Name()] = i } return nil }