Show / Hide Table of Contents

    Interface IProjectionService

    A IService that is used to get projections of CurrencyAmount earned with respect to time, using the current global ICurrency payout per millisecond, and vice versa.

    Namespace: IdleKit.Gameplay
    Assembly: cs.temp.dll.dll
    Syntax
    public interface IProjectionService : IService

    Methods

    GetPayoutProjections(Boolean)

    Get the current IPayoutProjections.

    Declaration
    IPayoutProjection[] GetPayoutProjections(bool refreshPayout = false)
    Parameters
    Type Name Description
    Boolean refreshPayout
    Returns
    Type Description
    IPayoutProjection[]
    Remarks

    This payout refresh process is relatively expensive so it is best to refreshPayout only when necessary.

    GetProjectedEarnings(ICurrency, Int64, Boolean)

    Get the projected earnings for the targetCurrency at the endTime based on the player's current global payout per millisecond.

    Declaration
    CurrencyAmount GetProjectedEarnings(ICurrency targetCurrency, long endTime, bool refreshPayout = false)
    Parameters
    Type Name Description
    ICurrency targetCurrency

    The target ICurrency to project earnings for.

    Int64 endTime

    The timestamp to end the projection at.

    Boolean refreshPayout

    Whether the currently cached IPayoutProjection should be refreshed or not.

    Returns
    Type Description
    CurrencyAmount

    GetProjectedEarnings(ICurrency, Int64, Int64, Boolean)

    An overload of GetProjectedEarnings(ICurrency, Int64, Boolean) with a startTime if you do not want to use the current GameTimestamp as the start time of the calculation.

    Declaration
    CurrencyAmount GetProjectedEarnings(ICurrency targetCurrency, long startTime, long endTime, bool refreshPayout = false)
    Parameters
    Type Name Description
    ICurrency targetCurrency

    The target ICurrency to project earnings for.

    Int64 startTime

    The timestamp to start the projection at.

    Int64 endTime

    The timestamp to end the projection at.

    Boolean refreshPayout

    Whether the currently cached IPayoutProjection should be refreshed or not.

    Returns
    Type Description
    CurrencyAmount

    GetProjectedEarnings(ICurrency[], Int64, Boolean)

    An overload of the GetProjectedEarnings(ICurrency, Int64, Boolean) targeting multiple targetCurrencies.

    Declaration
    CurrencyAmount[] GetProjectedEarnings(ICurrency[] targetCurrencies, long endTime, bool refreshPayout = false)
    Parameters
    Type Name Description
    ICurrency[] targetCurrencies

    An array of target ICurrencys to project earnings for.

    Int64 endTime

    The timestamp to end the projection at.

    Boolean refreshPayout

    Whether the currently cached IPayoutProjection should be refreshed or not.

    Returns
    Type Description
    CurrencyAmount[]

    GetProjectedEarnings(ICurrency[], Int64, Int64, Boolean)

    An overload of GetProjectedEarnings(ICurrency[], Int64, Boolean) with a startTime if you do not want to use the current GameTimestamp as the start time of the calculation.

    Declaration
    CurrencyAmount[] GetProjectedEarnings(ICurrency[] targetCurrencies, long startTime, long endTime, bool refreshPayout = false)
    Parameters
    Type Name Description
    ICurrency[] targetCurrencies

    An array of target ICurrencys to project earnings for.

    Int64 startTime

    The timestamp to start the projection at.

    Int64 endTime

    The timestamp to end the projection at.

    Boolean refreshPayout

    Whether the currently cached IPayoutProjection should be refreshed or not.

    Returns
    Type Description
    CurrencyAmount[]

    GetProjectedEarnings(Int64, Boolean)

    An overload of GetProjectedEarnings(ICurrency, Int64, Boolean) that targets all ICurrency.

    Declaration
    CurrencyAmount[] GetProjectedEarnings(long endTime, bool refreshPayout = false)
    Parameters
    Type Name Description
    Int64 endTime

    The timestamp to end the projection at.

    Boolean refreshPayout

    Whether the currently cached IPayoutProjection should be refreshed or not.

    Returns
    Type Description
    CurrencyAmount[]

    GetProjectedEarnings(Int64, Int64, Boolean)

    An overload of GetProjectedEarnings(ICurrency, Int64, Boolean) that targets all ICurrency and includes a startTime if you do not want to use the current GameTimestamp as the start time of the calculation.

    Declaration
    CurrencyAmount[] GetProjectedEarnings(long startTime, long endTime, bool refreshPayout = false)
    Parameters
    Type Name Description
    Int64 startTime

    The timestamp to start the projection at.

    Int64 endTime

    The timestamp to end the projection at.

    Boolean refreshPayout

    Whether the currently cached IPayoutProjection should be refreshed or not.

    Returns
    Type Description
    CurrencyAmount[]

    GetTimesToTargetAmounts(CurrencyAmount[], Boolean)

    An overload of GetTimeToTargetAmount(CurrencyAmount, Boolean) that gets the timestamps to reach multiple targetAmounts.

    Declaration
    long[] GetTimesToTargetAmounts(CurrencyAmount[] targetAmounts, bool refreshPayout = false)
    Parameters
    Type Name Description
    CurrencyAmount[] targetAmounts

    An array of target ICurrencys and amounts to be earned.

    Boolean refreshPayout

    Whether the currently cached IPayoutProjection should be refreshed or not.

    Returns
    Type Description
    Int64[]

    GetTimesToTargetAmounts(CurrencyAmount[], Int64, Boolean)

    An overload of the GetTimesToTargetAmounts(CurrencyAmount[], Boolean) with a start timestamp if you do not want to use the current GameTimestamp as the start time of the calculation.

    Declaration
    long[] GetTimesToTargetAmounts(CurrencyAmount[] targetAmounts, long startTime, bool refreshPayout = false)
    Parameters
    Type Name Description
    CurrencyAmount[] targetAmounts

    An array of target ICurrencys and amounts to be earned.

    Int64 startTime

    The timestamp to begin the projection from.

    Boolean refreshPayout

    Whether the currently cached IPayoutProjection should be refreshed or not.

    Returns
    Type Description
    Int64[]

    GetTimeToTargetAmount(CurrencyAmount, Boolean)

    Get the timestamp at which the specified ICurrency is projected to have been earned by the player based on their current payout per-millisecond. Returns MaxValue if the targetAmount cannot be complete and returns GameTimestamp if the player already has the amount specified.

    Declaration
    long GetTimeToTargetAmount(CurrencyAmount targetAmount, bool refreshPayout = false)
    Parameters
    Type Name Description
    CurrencyAmount targetAmount

    The target ICurrency and amount to be earned.

    Boolean refreshPayout

    Whether the currently cached IPayoutProjection should be refreshed or not.

    Returns
    Type Description
    Int64

    GetTimeToTargetAmount(CurrencyAmount, Int64, Boolean)

    An overload of the GetTimeToTargetAmount(CurrencyAmount, Boolean) with a start timestamp if you do not want to use the current GameTimestamp as the start time of the calculation.

    Declaration
    long GetTimeToTargetAmount(CurrencyAmount targetAmount, long startTime, bool refreshPayout = false)
    Parameters
    Type Name Description
    CurrencyAmount targetAmount

    The target ICurrency and amount to be earned.

    Int64 startTime

    The timestamp to begin the projection from.

    Boolean refreshPayout

    Whether the currently cached IPayoutProjection should be refreshed or not.

    Returns
    Type Description
    Int64

    RefreshPayoutProjections()

    Re-calculate the current IPayoutProjections. Each IPayoutProjection contains a the projected global payouts per-millisecond for each ICurrency up until the TimeExpired timestamp. This timestamp marks the point at which the global payouts per-millisecond are projected to change (eg. a ITimedBoost expiring).

    Declaration
    void RefreshPayoutProjections()
    Remarks

    This payout refresh process is relatively expensive so it is best to only be called when necessary.

    Back to top Copyright © 2020 East Side Games Inc.