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
serializedList
Properties
CombinationSlots
public Dictionary<int, CombinationSlotState> CombinationSlots { get; }
Property Value
Methods
AddSlot(Address, int)
public void AddSlot(Address address, int index = 0)
Parameters
addressAddressindexint
AddSlot(CombinationSlotState)
public void AddSlot(CombinationSlotState combinationSlotState)
Parameters
combinationSlotStateCombinationSlotState
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
slotStateIndexint
Returns
MigrationLegacySlotState(IWorldState, Address)
만약 AllCombinationSlotState가 없다면, 슬롯 확장 업데이트 전 4개의 슬롯을 가져와서 채워넣는다.
public static AllCombinationSlotState MigrationLegacySlotState(IWorldState worldState, Address avatarAddress)
Parameters
worldStateIWorldStateSlot 상태를 가져올 world state
avatarAddressAddressMigration을 진행할 아바타
Returns
- AllCombinationSlotState
Migration된 AllCombinationSlotState
MigrationLegacySlotState(Func<int, CombinationSlotState?>, Address)
만약 AllCombinationSlotState가 없다면, 슬롯 확장 업데이트 전 4개의 슬롯을 가져와서 채워넣는다.
public static AllCombinationSlotState MigrationLegacySlotState(Func<int, CombinationSlotState?> stateFactory, Address avatarAddress)
Parameters
stateFactoryFunc<int, CombinationSlotState>CombinationSlotState을 생성할 함수
avatarAddressAddressMigration을 진행할 아바타
Returns
- AllCombinationSlotState
Migration된 AllCombinationSlotState
Serialize()
public IValue Serialize()
Returns
- IValue
SetSlot(CombinationSlotState)
public void SetSlot(CombinationSlotState combinationSlotState)
Parameters
combinationSlotStateCombinationSlotState
TryGetSlot(int, out CombinationSlotState?)
public bool TryGetSlot(int slotStateIndex, out CombinationSlotState? combinationSlotState)
Parameters
slotStateIndexintcombinationSlotStateCombinationSlotState
Returns
UnlockSlot(Address, int)
public void UnlockSlot(Address avatarAddress, int index)
Parameters
avatarAddressAddressindexint