public T FindItem(ItemIdentifier identifier) { T item; if (this.itemsByIDs.TryGetValue(identifier.IdentifierString, out item)) { return(item); } else { return(null); } }
public void Load(string filesDirectory, Domain domain) { // initialize CSV reader/writer CSVTable table = new CSVTable(filesDirectory, this.TableName, this.columnDefinitions); // initialize postload cache this.loadCache = new List <PostLoadData <T> >(); // read the CSV List <CSVTableRow> rows = table.Load(); foreach (CSVTableRow row in rows) { T item = this.LoadItem(row); string id = ItemIdentifier.CreateIdentifierString(domain, this.TableName, item.InnerName); // add to postload cache this.loadCache.Add(new PostLoadData <T>(row, item)); this.AddItem(id, item); } }
StringIdentifiedRegistryItem IGameLoader.FindItem(ItemIdentifier identifier) { return(this.FindItem(identifier)); }