Centralize catalog item object lookup
This commit is contained in:
parent
b32a412df2
commit
0cf4591b8f
11 changed files with 24 additions and 21 deletions
|
|
@ -57,6 +57,14 @@ namespace GameCult.Aetheria.State.Verse
|
|||
return TryGet(_itemsByKey, itemKey);
|
||||
}
|
||||
|
||||
public AetheriaRuntimeCatalogItem? FindItem<T>(T? item, Func<T, string?> itemKey) where T : class
|
||||
{
|
||||
if (item == null || itemKey == null)
|
||||
return null;
|
||||
|
||||
return FindItem(itemKey(item) ?? "");
|
||||
}
|
||||
|
||||
public AetheriaRuntimeCorporation? FindCorporation(string corporationKey)
|
||||
{
|
||||
return TryGet(_corporationsByKey, corporationKey);
|
||||
|
|
|
|||
Loading…
Reference in a new issue