Interface IItemCollection<TItem>
Describes collection of items for game database.
public interface IItemCollection<TItem> : IItemCollection, IDisposable, ICollection<TItem>, IEnumerable<TItem>, IEnumerable where TItem : DatabaseObject
Type Parameters
TItem
- Inherited Members
- Extension Methods
Properties
this[Guid]
Gets or sets item from collection.
TItem this[Guid id] { get; set; }
Parameters
idGuidId of an item.
Property Value
- TItem
nullif no item is found otherwise item represents by specified id.
Methods
Add(MetadataProperty)
TItem Add(MetadataProperty property)
Parameters
propertyMetadataProperty
Returns
- TItem
Add(IEnumerable<MetadataProperty>)
IEnumerable<TItem> Add(IEnumerable<MetadataProperty> properties)
Parameters
propertiesIEnumerable<MetadataProperty>
Returns
- IEnumerable<TItem>
Add(IEnumerable<TItem>)
Adds items to collection.
void Add(IEnumerable<TItem> items)
Parameters
itemsIEnumerable<TItem>Item to be added.
Add(List<string>)
Adds new items into collection.
IEnumerable<TItem> Add(List<string> items)
Parameters
Returns
- IEnumerable<TItem>
Newly added items or existing items if there are some present with the same names.
Add(List<string>, Func<TItem, string, bool>)
Adds new items into collection.
IEnumerable<TItem> Add(List<string> items, Func<TItem, string, bool> existingComparer)
Parameters
itemsList<string>Names of items to be added.
existingComparerFunc<TItem, string, bool>Method to detect existing item from database compared to new item.
Returns
- IEnumerable<TItem>
Add(string)
Adds new item into collection.
TItem Add(string itemName)
Parameters
itemNamestringName of new item.
Returns
- TItem
Newly added item or existing item if one is present with the same name.
Add(string, Func<TItem, string, bool>)
Adds new item into collection.
TItem Add(string itemName, Func<TItem, string, bool> existingComparer)
Parameters
itemNamestringName of new item.
existingComparerFunc<TItem, string, bool>Method to detect existing item from database compared to new item.
Returns
- TItem
Newly added item or existing item if one is present with the same name.
BeginBufferUpdate()
Sets collection into buffered update state.
void BeginBufferUpdate()
BufferedUpdate()
Switches collection to buffered mode. Suppresses all notification events until buffering is stopped.
IDisposable BufferedUpdate()
Returns
- IDisposable
Buffer object.
EndBufferUpdate()
Sets collection from buffered update state.
void EndBufferUpdate()
Get(IList<Guid>)
Gets items from collection.
List<TItem> Get(IList<Guid> ids)
Parameters
Returns
- List<TItem>
List of items from collection.
Get(Guid)
Gets item from collection.
TItem Get(Guid id)
Parameters
idGuidId of an item.
Returns
- TItem
nullif no item is found otherwise item represents by specified id.
GetClone()
Gets clone of a collection.
IEnumerable<TItem> GetClone()
Returns
- IEnumerable<TItem>
Remove(IEnumerable<TItem>)
Removes items from collection.
bool Remove(IEnumerable<TItem> items)
Parameters
itemsIEnumerable<TItem>List of items to be removed.
Returns
Remove(Guid)
Removes item from collection.
bool Remove(Guid id)
Parameters
idGuidId of an item to be removed.
Returns
Update(IEnumerable<TItem>)
Updates states of items in collection.
void Update(IEnumerable<TItem> items)
Parameters
itemsIEnumerable<TItem>New states of items.
Update(TItem)
Updates state of item in collection.
void Update(TItem item)
Parameters
itemTItemNew state of an object.
Events
ItemCollectionChanged
Occurs when items are added or removed.
event EventHandler<ItemCollectionChangedEventArgs<TItem>> ItemCollectionChanged
Event Type
ItemUpdated
Occurs when items are updated.
event EventHandler<ItemUpdatedEventArgs<TItem>> ItemUpdated
Event Type
- EventHandler<ItemUpdatedEventArgs<TItem>>