Class World
An internal implementation of IWorld.
Inheritance
Namespace: Libplanet.Action.State
Assembly: Libplanet.Action.dll
Syntax
public class World : object, IWorld, IWorldState
Constructors
| Improve this Doc View SourceWorld(IWorldState)
An internal implementation of IWorld.
Declaration
public World(IWorldState baseState)
Parameters
Type | Name | Description |
---|---|---|
IWorldState | baseState |
Properties
| Improve this Doc View SourceDelta
Declaration
public IWorldDelta Delta { get; }
Property Value
Type | Description |
---|---|
IWorldDelta |
Legacy
Whether IWorldState is backed by an ITrie with the legacy data model. This is true if and only if Version is less than WorldStateProtocolVersion.
Declaration
public bool Legacy { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Trie
The ITrie of the IWorldState.
Declaration
public ITrie Trie { get; }
Property Value
Type | Description |
---|---|
ITrie |
Version
The version of the backend ITrie data model. This should be in sync with ProtocolVersion of the IPreEvaluationBlock getting evaluated. As this was only introduced since WorldStateProtocolVersion, this returns zero with any ITrie representing an IWorldState before WorldStateProtocolVersion or any ITrie representing an IAccountState.
Declaration
public int Version { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
See Also
Methods
| Improve this Doc View SourceGetAccount(Address)
Gets the IAccount of the given address
.
Declaration
public IAccount GetAccount(Address address)
Parameters
Type | Name | Description |
---|---|---|
Address | address | The Address referring the world to get its state. |
Returns
Type | Description |
---|---|
IAccount | The IAccount of the given |
GetAccountState(Address)
Gets the IAccountState of the given address
.
Declaration
public IAccountState GetAccountState(Address address)
Parameters
Type | Name | Description |
---|---|---|
Address | address | The Address referring the world to get its state. |
Returns
Type | Description |
---|---|
IAccountState | The IAccountState of the given |
SetAccount(Address, IAccount)
Creates a new instance of IWorld with given address
set to given account
.
Declaration
public IWorld SetAccount(Address address, IAccount account)
Parameters
Type | Name | Description |
---|---|---|
Address | address | The Address for which to set
given |
IAccount | account | The new IAccount to set to
given |
Returns
Type | Description |
---|---|
IWorld | A new IWorld instance where the account state of given
|
Remarks
This method does not manipulate the instance, but returns a new IWorld instance with an updated world state instead.