2020-09-19 14:33:40 -04:00
|
|
|
package d2records
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2txt"
|
|
|
|
)
|
|
|
|
|
|
|
|
func monsterTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|
|
|
records := make(MonsterTypes)
|
|
|
|
|
|
|
|
for d.Next() {
|
|
|
|
record := &MonTypeRecord{
|
|
|
|
Type: d.String("type"),
|
|
|
|
Equiv1: d.String("equiv1"),
|
|
|
|
Equiv2: d.String("equiv2"),
|
|
|
|
Equiv3: d.String("equiv3"),
|
|
|
|
StrSing: d.String("strsing"),
|
|
|
|
StrPlural: d.String("strplur"),
|
|
|
|
}
|
|
|
|
records[record.Type] = record
|
|
|
|
}
|
|
|
|
|
|
|
|
if d.Err != nil {
|
|
|
|
panic(d.Err)
|
|
|
|
}
|
|
|
|
|
2020-12-18 01:40:54 -05:00
|
|
|
r.Debugf("Loaded %d MonType records", len(records))
|
2020-09-19 14:33:40 -04:00
|
|
|
|
|
|
|
r.Monster.Types = records
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|