Interface IWorld
An interface to manipulate an world state with maintaining Delta.
It is like a map which is virtually initialized such that every possible Address exists and is mapped to null. That means that:
- it does not have length,
- its index getter never throws KeyNotFoundException, but returns null instead, and
- filling an Address with null account cannot be distinguished from the Address having never been set to any account.
Namespace: Libplanet.Action.State
Assembly: Libplanet.Action.dll
Syntax
public interface IWorld : IWorldState
Remarks
This interface is immutable. SetAccount(Address, IAccount) method does not manipulate the instance, but returns a new IWorld instance with updated states.
Properties
| Improve this Doc View SourceDelta
Declaration
[Pure]
IWorldDelta Delta { get; }
Property Value
Type | Description |
---|---|
IWorldDelta |
Remarks
This interface is immutable. SetAccount(Address, IAccount) method does not manipulate the instance, but returns a new IWorld instance with updated states.
Methods
| Improve this Doc View SourceGetAccount(Address)
Gets the IAccount of the given address
.
Declaration
[Pure]
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 |
Remarks
This interface is immutable. SetAccount(Address, IAccount) method does not manipulate the instance, but returns a new IWorld instance with updated states.
SetAccount(Address, IAccount)
Creates a new instance of IWorld with given address
set to given account
.
Declaration
[Pure]
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 method does not manipulate the instance, but returns a new IWorld instance with an updated world state instead.
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown for one of the following reasons:
|