예제 #1
0
        public T FindItem(ItemIdentifier identifier)
        {
            T item;

            if (this.itemsByIDs.TryGetValue(identifier.IdentifierString, out item))
            {
                return(item);
            }
            else
            {
                return(null);
            }
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
 StringIdentifiedRegistryItem IGameLoader.FindItem(ItemIdentifier identifier)
 {
     return(this.FindItem(identifier));
 }