Migrate NPC registry durable contract

This commit is contained in:
2026-08-05 18:25:04 +00:00
parent 916a32195b
commit 9653e06297
56 changed files with 256 additions and 237 deletions

View File

@@ -28,7 +28,7 @@ func appendSpellLists(values []dnd.SpellList) (dnd.SpellList, error) {
return combined, nil
}
func appendNPCLists(values []dnd.NPCList) (dnd.NPCList, error) {
func appendNPCRegistries(values []dnd.NPCRegistry) (dnd.NPCRegistry, error) {
count := 0
present := false
for _, value := range values {
@@ -38,9 +38,9 @@ func appendNPCLists(values []dnd.NPCList) (dnd.NPCList, error) {
count += len(value.NPCs)
}
if !present {
return dnd.NPCList{}, nil
return dnd.NPCRegistry{}, nil
}
combined := dnd.NPCList{NPCs: make([]dnd.NPC, 0, count)}
combined := dnd.NPCRegistry{NPCs: make([]dnd.NPC, 0, count)}
for _, value := range values {
for _, npc := range value.NPCs {
combined.NPCs = append(combined.NPCs, cloneNPC(npc))