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.Framework
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
Upgrade()
Upgrades the Entity
Declaration
void Upgrade()