Show / Hide Table of Contents

    Interface IUpgradeable

    This interface can be implemented by Entities that can be upgraded. An Upgradeable Entity will have to track an upgrade level which can be used to retrieve relevant data. In IdleKit, IUpgradeables are generally also IModifiers, tying UpgradeLevel progression to the ModifierDataIndex progression.

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

    Properties

    IsMaxLevel

    Returns true if the Entity has been upgraded to its max level

    Declaration
    bool IsMaxLevel { get; }
    Property Value
    Type Description
    Boolean

    Level

    Returns the current level of this IUpgradeable

    Declaration
    int Level { get; }
    Property Value
    Type Description
    Int32

    MaxLevel

    Returns the max level of this IUpgradeable

    Declaration
    int MaxLevel { get; }
    Property Value
    Type Description
    Int32

    UpgradeableId

    Returns the id that can be used to retrieve this Entity This is almost always the EntityData id as seen in Id

    Declaration
    string UpgradeableId { get; }
    Property Value
    Type Description
    String

    UpgradeableSavedData

    Returns the IUpgradeableSavedData associated with this Entity

    Declaration
    IUpgradeableSavedData UpgradeableSavedData { get; }
    Property Value
    Type Description
    IUpgradeableSavedData

    Methods

    CanUpgrade()

    Returns true if the Entity can be upgraded

    Declaration
    bool CanUpgrade()
    Returns
    Type Description
    Boolean

    GetLevelUpgradeData(Int32)

    Returns the IUpgradeLevelData associated with the supplied upgradeLevel

    Declaration
    IUpgradeLevelData GetLevelUpgradeData(int upgradeLevel)
    Parameters
    Type Name Description
    Int32 upgradeLevel
    Returns
    Type Description
    IUpgradeLevelData
    Examples

    By passing UpgradeLevel into this method, the upgrade requirements to reach the next level will be returned

    GetNextUpgradeRequirement()

    Returns an IUpgradeRequirement object that contains information on the requirements to upgrade the IUpgradeable to the next level.

    Declaration
    IUpgradeRequirement[] GetNextUpgradeRequirement()
    Returns
    Type Description
    IUpgradeRequirement[]

    GetUpgradeRequirement(String)

    Returns the amount of ICurrency which is required to purchase the next level of this IUpgradeable for the specific requirement.

    Declaration
    double GetUpgradeRequirement(string requirementId)
    Parameters
    Type Name Description
    String requirementId

    The id of the requirement whose amount we're trying to retrieve.

    Returns
    Type Description
    Double

    Upgrade()

    Upgrades the Entity

    Declaration
    void Upgrade()
    Back to top Copyright © 2020 East Side Games Inc.