MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / LoadDataFiles

Function LoadDataFiles

internal/mobs/mobs.go:832–853  ·  view source on GitHub ↗

file self loads due to init()

()

Source from the content-addressed store, hash-verified

830
831// file self loads due to init()
832func LoadDataFiles() {
833
834 start := time.Now()
835
836 tmpMobs, err := fileloader.LoadAllFlatFiles[int, *Mob](configs.GetFilePathsConfig().DataFiles.String() + `/mobs`)
837 if err != nil {
838 panic(err)
839 }
840
841 mobs = tmpMobs
842
843 clear(mobNameCache)
844
845 for _, mob := range mobs {
846 allMobNames = append(allMobNames, mob.Character.Name)
847 // Keep track of all original names associated with a given mobId
848 mobNameCache[mob.MobId] = mob.Character.Name
849 }
850
851 mudlog.Info("mobs.LoadDataFiles()", "loadedCount", len(mobs), "Time Taken", time.Since(start))
852
853}

Callers 1

loadAllDataFilesFunction · 0.92

Calls 3

GetFilePathsConfigFunction · 0.92
InfoFunction · 0.92
StringMethod · 0.65

Tested by

no test coverage detected