Show / Hide Table of Contents

    Class LeaderboardsTools

    Inheritance
    Object
    LeaderboardsTools
    Namespace: IdleKit.Gameplay
    Assembly: cs.temp.dll.dll
    Syntax
    public class LeaderboardsTools : IInjectable

    Constructors

    LeaderboardsTools()

    Declaration
    public LeaderboardsTools()

    LeaderboardsTools(LeaderboardsService)

    Declaration
    public LeaderboardsTools(LeaderboardsService leaderboardsService)
    Parameters
    Type Name Description
    LeaderboardsService leaderboardsService

    Fields

    _entityResolver

    Declaration
    protected IEntityResolver _entityResolver
    Field Value
    Type Description
    IEntityResolver

    _leaderboardsService

    Declaration
    protected ILeaderboardsService _leaderboardsService
    Field Value
    Type Description
    ILeaderboardsService

    _projectionCalculator

    Declaration
    protected IProjectionCalculator _projectionCalculator
    Field Value
    Type Description
    IProjectionCalculator

    _projectionService

    Declaration
    protected IProjectionService _projectionService
    Field Value
    Type Description
    IProjectionService

    _stringBuilder

    Declaration
    protected StringBuilder _stringBuilder
    Field Value
    Type Description
    StringBuilder

    _timerService

    Declaration
    protected ITimerService _timerService
    Field Value
    Type Description
    ITimerService

    _userSavedData

    Declaration
    protected IUserSavedData _userSavedData
    Field Value
    Type Description
    IUserSavedData

    _userStatsService

    Declaration
    protected IUserStatsService _userStatsService
    Field Value
    Type Description
    IUserStatsService

    FINAL_SCORE

    Declaration
    public const string FINAL_SCORE = "_final_score"
    Field Value
    Type Description
    String

    PROJECTION_CURRENCY

    Declaration
    public const string PROJECTION_CURRENCY = "projectionCurrency"
    Field Value
    Type Description
    String

    PROJECTIONS

    Declaration
    public const string PROJECTIONS = "projections"
    Field Value
    Type Description
    String

    SUBMISSION_TIME

    Declaration
    public const string SUBMISSION_TIME = "submissionTime"
    Field Value
    Type Description
    String

    Methods

    CalculateCurrentProjectedScore(Dictionary<String, String>, String)

    Parses out the projections information from the leaderboard entry's stats dictionary and uses the ProjectionService to return how much score the player would earn by now from their last leaderboard entry submission time.

    Declaration
    public virtual double CalculateCurrentProjectedScore(Dictionary<string, string> stats, string currencyId)
    Parameters
    Type Name Description
    Dictionary<String, String> stats

    A dictionary with specifically formatted projection string. See generation of this format in GetStandardLeaderboardEntryStats() method

    String currencyId

    Id of the currency which equates to score in the leaderboard.

    Returns
    Type Description
    Double

    ConvertLeaderboard(LeaderBoardView, String, String)

    Parses the incoming Beamable leaderboard data structure into an list of IdleKit's Leaderboard Entries. Also uses the ProjectionService to parse projections and calculate the player's earnings from the last leaderboard entry submission time.

    Declaration
    public virtual Task<List<LeaderboardEntry>> ConvertLeaderboard(LeaderBoardView view, string leaderboardId, string leaderboardCurrencyId)
    Parameters
    Type Name Description
    LeaderBoardView view

    Beamable specific leaderboard data structure.

    String leaderboardId

    Id of the leaderboard.

    String leaderboardCurrencyId

    Id of the currency which equates to score in this leaderboard.

    Returns
    Type Description
    Task<List<LeaderboardEntry>>

    GetStandardLeaderboardEntryStats()

    Returns payout projections as a string to be parsed on the client to calculate approximate earnings for the player on the leaderboard while offline. Also returns the leaderboard score submission time

    Declaration
    public virtual Dictionary<string, string> GetStandardLeaderboardEntryStats()
    Returns
    Type Description
    Dictionary<String, String>

    Inject(IResolver)

    Declaration
    public virtual void Inject(IResolver resolver)
    Parameters
    Type Name Description
    IResolver resolver
    Back to top Copyright © 2020 East Side Games Inc.