Interface IProjectionCalculator
The helper class utilized by the IProjectionService that performs the actual projection calculations.
Namespace: IdleKit.Framework
Assembly: cs.temp.dll.dll
Syntax
public interface IProjectionCalculator
Methods
CalculateEarningsByTime(IPayoutProjection[], ICurrency, Int64, Int64)
Calculate the CurrencyAmount of the targetCurrency
that will be earned based on the current
payoutProjections
from startTime
until endTime
.
Declaration
CurrencyAmount CalculateEarningsByTime(IPayoutProjection[] payoutProjections, ICurrency targetCurrency, long startTime, long endTime)
Parameters
Type | Name | Description |
---|---|---|
IPayoutProjection[] | payoutProjections | The payout rates for all ICurrencys and the timestamp they're valid until. |
ICurrency | targetCurrency | The ICurrency that we are calculating the earnings for. |
Int64 | startTime | The start timestamp of the calculation. |
Int64 | endTime | The end timestamp of the calculation |
Returns
Type | Description |
---|---|
CurrencyAmount | The CurrencyAmount that will be earned based over the time specified via the input parameters. |
CalculateTimeToTarget(IPayoutProjection[], CurrencyAmount, Int64)
Calculates the timestamp when the targetAmount
of ICurrency are reached, based on the
global payout-per-milliseconds contained in payoutProjections
. Projected from the startTime
.
Declaration
long CalculateTimeToTarget(IPayoutProjection[] payoutProjections, CurrencyAmount targetAmount, long startTime)
Parameters
Type | Name | Description |
---|---|---|
IPayoutProjection[] | payoutProjections | The payout rates for all ICurrencys and the timestamp they're valid until. |
CurrencyAmount | targetAmount | The amount of ICurrency to be earned by the end of the calculation. |
Int64 | startTime | The start timestamp of the calculation. |
Returns
Type | Description |
---|---|
Int64 | The end timestamp at which the |
Remarks
If the cannot be reached, MaxValue will be returned.