Class AllCombinationSlotState
This is new version of combination slot State. This state stores all combinationSlot states of an avatar. AllCombinationSlotState has all combinationSlotStates as dictionary and has methods to get/set/update each combinationSlotState. Use this with CombinationSlotStateModule.
public class AllCombinationSlotState : IState, IEnumerable<CombinationSlotState>, IEnumerable
- Inheritance
-
AllCombinationSlotState
- Implements
- Inherited Members
Constructors
AllCombinationSlotState()
public AllCombinationSlotState()
AllCombinationSlotState(List)
public AllCombinationSlotState(List serialized)
Parameters
serialized
List
Properties
CombinationSlots
public Dictionary<int, CombinationSlotState> CombinationSlots { get; }
Property Value
Methods
AddSlot(Address, int)
public void AddSlot(Address address, int index = 0)
Parameters
address
Addressindex
int
AddSlot(CombinationSlotState)
public void AddSlot(CombinationSlotState combinationSlotState)
Parameters
combinationSlotState
CombinationSlotState
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<CombinationSlotState> GetEnumerator()
Returns
- IEnumerator<CombinationSlotState>
An enumerator that can be used to iterate through the collection.
GetSlot(int)
public CombinationSlotState GetSlot(int slotStateIndex)
Parameters
slotStateIndex
int
Returns
MigrationLegacySlotState(IWorldState, Address)
만약 AllCombinationSlotState가 없다면, 슬롯 확장 업데이트 전 4개의 슬롯을 가져와서 채워넣는다.
public static AllCombinationSlotState MigrationLegacySlotState(IWorldState worldState, Address avatarAddress)
Parameters
worldState
IWorldStateSlot 상태를 가져올 world state
avatarAddress
AddressMigration을 진행할 아바타
Returns
- AllCombinationSlotState
Migration된 AllCombinationSlotState
MigrationLegacySlotState(Func<int, CombinationSlotState?>, Address)
만약 AllCombinationSlotState가 없다면, 슬롯 확장 업데이트 전 4개의 슬롯을 가져와서 채워넣는다.
public static AllCombinationSlotState MigrationLegacySlotState(Func<int, CombinationSlotState?> stateFactory, Address avatarAddress)
Parameters
stateFactory
Func<int, CombinationSlotState>CombinationSlotState을 생성할 함수
avatarAddress
AddressMigration을 진행할 아바타
Returns
- AllCombinationSlotState
Migration된 AllCombinationSlotState
Serialize()
public IValue Serialize()
Returns
- IValue
SetSlot(CombinationSlotState)
public void SetSlot(CombinationSlotState combinationSlotState)
Parameters
combinationSlotState
CombinationSlotState
TryGetSlot(int, out CombinationSlotState?)
public bool TryGetSlot(int slotStateIndex, out CombinationSlotState? combinationSlotState)
Parameters
slotStateIndex
intcombinationSlotState
CombinationSlotState
Returns
UnlockSlot(Address, int)
public void UnlockSlot(Address avatarAddress, int index)
Parameters
avatarAddress
Addressindex
int