ValueAccumulator<T>
Class in Zigurous.Architecture
Declaration
public abstract class ValueAccumulator<T>
Description
Accumulates a set of stored values into a single total value.
Type Parameters
T | The type of value to accumulate. |
Properties
values | The stored values with their given identifiers (Read only). |
Total | The total accumulated value (Read only). |
Count | The number of unique values being accumulated (Read only). |
DefaultValue | The default value of T . |
Constructors
ValueAccumulator | Creates a new instance of the value accumulator. |
Methods
GetValue | Returns the value stored with the specified identifier. |
SetValue | Stores a given value with the specified identifier. The total accumulated value is updated based on the difference between the new and old value. |
RemoveValue | Removes the value stored with the given identifier and updates the total accumulated value. |
Clear | Removes all stored values and resets the total accumulated value. |
Add | Increases the accumulated total by a given value. |
Subtract | Decreases the accumulated total by a given value. |