Class PartitionedData<TPartition, TEntry>
Partitioned data is used for high update frequency data such as Chat and Notifications. For each new day, a new data partition will be created and since each individual data partition
is IStorage, they are saved separately and that heavily enhances serialization speed, because only the active partition needs to be saved on updates as the previous ones are locked.
Inheritance
System.Object
PartitionedData<TPartition, TEntry>
Assembly: Eco.Gameplay.dll
Syntax
public class PartitionedData<TPartition, TEntry> : Object, IDataPartition<TEntry> where TPartition : IStoredDataPartition<TEntry>, new()
where TEntry : ISerializable, IHasCreationTime
Type Parameters
Name |
Description |
TPartition |
|
TEntry |
|
Properties
NumEntries
Declaration
public int NumEntries { get; }
Property Value
Type |
Description |
System.Int32 |
|
Methods
AddEntry(TEntry)
Declaration
public void AddEntry(TEntry entry)
Parameters
Type |
Name |
Description |
TEntry |
entry |
|
GetEnumerable()
Declaration
public IEnumerable<TEntry> GetEnumerable()
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<TEntry> |
|
LoadOrCreate(String)
Loads data from storage or creates new.
Declaration
public static PartitionedData<TPartition, TEntry> LoadOrCreate(string folder)
Parameters
Type |
Name |
Description |
System.String |
folder |
|
Returns
RemoveAll(Predicate<TEntry>)
Removes all entries matching predicate
and returns number of removed entries.
Declaration
public int RemoveAll(Predicate<TEntry> predicate)
Parameters
Type |
Name |
Description |
System.Predicate<TEntry> |
predicate |
|
Returns
Type |
Description |
System.Int32 |
|
Implements
Extension Methods