private void TryToRemoveResource(ResourceItem resourceItem) { if (!resourceItem.IsInUse) { var typeCollection = this.EnsureTypeCollection(resourceItem.Type); typeCollection.Remove(resourceItem.Hash); } }
internal IResourceItem EnsureItem(Dictionary<uint, IResourceItem> typeCollection, uint type, uint hash) { IResourceItem item; if (!typeCollection.TryGetValue(hash, out item)) { item = new ResourceItem(this, type, hash); typeCollection.Add(hash, item); } return item; }