DataStoreT Class |
Namespace: DigitalRune.Game
The DataStoreT type exposes the following members.
Name | Description | |
---|---|---|
DataStoreT |
Initializes a new instance of the DataStoreT class.
|
Name | Description | |
---|---|---|
Clear |
Removes all items from the data store.
| |
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
Get |
Gets the item for the given ID.
| |
GetByIndex |
Gets the item at the given index.
| |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetIdByIndex |
Gets the ID of the item at the given index.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
IndexOf |
Gets the index of the given item.
| |
IndexOfId |
Searches for the index of the item with the given ID.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Remove |
Removes data with the given ID.
| |
RemoveAt |
Removes the item at the given index.
| |
Set |
Adds the given item to the data store.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Data in the DataStoreT can be be accessed using an ID or index. ID: Each data item must have a unique ID. The ID is required to read/write data items. Storing a data item with a certain ID will add a new entry to the data store - or overwrite an existing entry, if an entry with for given ID already exits. Data items are sorted ascending based on their ID for fast retrieval. Accessing data items based on their ID is O(log n).
Index: Data items can also be read based on their index in the data store. However, this approach is not recommended as the index will change when data items are added or removed. Reading data based on their index is O(1).