1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-22 23:25:23 +00:00
OpenDiablo2/d2common/d2data/d2datadict/unique_appellation.go
Bojan Novković 247bda97c6
Added loaders for itemratio.txt, Overlay.txt and UniqueAppellation.txt (#660)
* Added loaders for itemratio.txt, Overlay.txt, UniqueAppellation.txt

* Adjust unique appellation loader for expansion data

* fixes: response to PR comments

* overlay.go: PR comment fixes

Co-authored-by: Bojan Novkovic <bojan.novkovic@kset.org>
2020-07-31 18:14:41 -04:00

33 lines
616 B
Go

package d2datadict
import (
"log"
"github.com/OpenDiablo2/OpenDiablo2/d2common"
)
type UniqueAppellationRecord struct {
// The title
Name string
}
var UniqueAppellations map[string]*UniqueAppellationRecord
func LoadUniqueAppellations(file []byte) {
UniqueAppellations = make(map[string]*UniqueAppellationRecord)
d := d2common.LoadDataDictionary(file)
for d.Next() {
record := &UniqueAppellationRecord{
Name: d.String("Name"),
}
UniqueAppellations[record.Name] = record
}
if d.Err != nil {
panic(d.Err)
}
log.Printf("Loaded %d UniqueAppellation records", len(UniqueAppellations))
}