1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-25 00:25:23 +00:00
OpenDiablo2/d2core/d2records/gamble_loader.go

28 lines
456 B
Go
Raw Normal View History

2020-10-10 22:45:28 +00:00
package d2records
import (
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2txt"
)
func gambleLoader(r *RecordManager, d *d2txt.DataDictionary) error {
records := make(Gamble)
for d.Next() {
record := &GambleRecord{
Name: d.String("name"),
Code: d.String("code"),
}
records[record.Name] = record
}
if d.Err != nil {
return d.Err
}
2020-12-18 06:40:54 +00:00
r.Debugf("Loaded %d Gamble records", len(records))
2020-10-10 22:45:28 +00:00
r.Gamble = records
return nil
}