Class Energy
Holds information related to user energy and NFTs
Namespace: ColizeumSDK.Models
Assembly: cs.temp.dll.dll
Syntax
public class Energy
Fields
current
Currently available energy the User has
Declaration
public int current
Field Value
| Type | Description |
|---|---|
| Int32 |
max
Maximum available energy the User has
Declaration
public int max
Field Value
| Type | Description |
|---|---|
| Int32 |
tokens
Declaration
public List<Token> tokens
Field Value
| Type | Description |
|---|---|
| List<Token> |
Methods
Consume(Int32, String, Action<ConsumeEnergyResponse>, Action<Exception>)
Consumes user energy from a specific token (if provided)
Declaration
public void Consume(int amount, string tokenId = null, Action<ConsumeEnergyResponse> onSuccess = null, Action<Exception> onError = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | amount | Energy amount that will be consumed |
| String | tokenId | Token ID from which the energy will be consumed (optional) |
| Action<ConsumeEnergyResponse> | onSuccess | |
| Action<Exception> | onError |
Refresh(Action)
Fetches latest information from the API and updates the model
Declaration
public void Refresh(Action onSuccess = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Action | onSuccess |