Restructured for new direction.

This commit is contained in:
2026-05-12 12:01:09 +01:00
parent 0439b6c1d2
commit c203f836b1
1134 changed files with 125569 additions and 213519 deletions

View File

@@ -35,39 +35,38 @@ namespace BriarQueen.Framework.Registries
{
_entryLookup = new Dictionary<string, ItemDataSo>();
AddEntries(_puzzleSlots, "Puzzle Slots");
AddEntries(_pickupItems, "Pickup Items");
AddEntries(_environmentInteractables, "Environment Interactables");
}
RegistryLookupBuilder.AddEntries(
_entryLookup,
_puzzleSlots,
this,
nameof(ItemRegistry),
"Puzzle Slots",
"UniqueID",
entry => entry.UniqueID,
entry => entry,
entry => RegistryLookupBuilder.HasNonEmptyKey(entry.UniqueID));
private void AddEntries(List<ItemDataSo> entries, string category)
{
if (entries == null)
return;
RegistryLookupBuilder.AddEntries(
_entryLookup,
_pickupItems,
this,
nameof(ItemRegistry),
"Pickup Items",
"UniqueID",
entry => entry.UniqueID,
entry => entry,
entry => RegistryLookupBuilder.HasNonEmptyKey(entry.UniqueID));
foreach (var entry in entries)
{
if (entry == null)
continue;
if (string.IsNullOrWhiteSpace(entry.UniqueID))
{
Debug.LogWarning(
$"[ItemRegistry] Skipping {category} entry '{entry.name}' because UniqueID is empty.",
this);
continue;
}
if (_entryLookup.ContainsKey(entry.UniqueID))
{
Debug.LogError(
$"[ItemRegistry] Duplicate UniqueID detected: '{entry.UniqueID}' from entry '{entry.name}'.",
this);
continue;
}
_entryLookup.Add(entry.UniqueID, entry);
}
RegistryLookupBuilder.AddEntries(
_entryLookup,
_environmentInteractables,
this,
nameof(ItemRegistry),
"Environment Interactables",
"UniqueID",
entry => entry.UniqueID,
entry => entry,
entry => RegistryLookupBuilder.HasNonEmptyKey(entry.UniqueID));
}
public bool TryGetEntry(string itemID, out ItemDataSo entry)
@@ -130,4 +129,4 @@ namespace BriarQueen.Framework.Registries
}
#endif
}
}
}