Table of Contents

Class WeeklyArenaState

Namespace
Nekoyume.Model.State
Assembly
Lib9c.dll
[Serializable]
public class WeeklyArenaState : State, IState, IDictionary<Address, ArenaInfo>, ICollection<KeyValuePair<Address, ArenaInfo>>, IEnumerable<KeyValuePair<Address, ArenaInfo>>, IEnumerable, ISerializable
Inheritance
WeeklyArenaState
Implements
Inherited Members

Constructors

WeeklyArenaState(Dictionary)

public WeeklyArenaState(Dictionary serialized)

Parameters

serialized Dictionary

WeeklyArenaState(IValue)

public WeeklyArenaState(IValue iValue)

Parameters

iValue IValue

WeeklyArenaState(Address)

public WeeklyArenaState(Address address)

Parameters

address Address

WeeklyArenaState(int)

public WeeklyArenaState(int index)

Parameters

index int

WeeklyArenaState(SerializationInfo, StreamingContext)

protected WeeklyArenaState(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo
context StreamingContext

Fields

Ended

public bool Ended

Field Value

bool

ResetIndex

public long ResetIndex

Field Value

long

Properties

Count

Gets the number of elements contained in the ICollection<T>.

public int Count { get; }

Property Value

int

The number of elements contained in the ICollection<T>.

IsReadOnly

Gets a value indicating whether the ICollection<T> is read-only.

public bool IsReadOnly { get; }

Property Value

bool

true if the ICollection<T> is read-only; otherwise, false.

this[Address]

Gets or sets the element with the specified key.

public ArenaInfo this[Address key] { get; set; }

Parameters

key Address

The key of the element to get or set.

Property Value

ArenaInfo

The element with the specified key.

Exceptions

ArgumentNullException

key is null.

KeyNotFoundException

The property is retrieved and key is not found.

NotSupportedException

The property is set and the IDictionary<TKey, TValue> is read-only.

Keys

Gets an ICollection<T> containing the keys of the IDictionary<TKey, TValue>.

public ICollection<Address> Keys { get; }

Property Value

ICollection<Address>

An ICollection<T> containing the keys of the object that implements IDictionary<TKey, TValue>.

Map

public IReadOnlyDictionary<Address, LazyState<ArenaInfo, Dictionary>> Map { get; }

Property Value

IReadOnlyDictionary<Address, LazyState<ArenaInfo, Dictionary>>

OrderedArenaInfos

public List<ArenaInfo> OrderedArenaInfos { get; }

Property Value

List<ArenaInfo>

Values

Gets an ICollection<T> containing the values in the IDictionary<TKey, TValue>.

public ICollection<ArenaInfo> Values { get; }

Property Value

ICollection<ArenaInfo>

An ICollection<T> containing the values in the object that implements IDictionary<TKey, TValue>.

Methods

Add(Address, ArenaInfo)

Adds an element with the provided key and value to the IDictionary<TKey, TValue>.

public void Add(Address key, ArenaInfo value)

Parameters

key Address

The object to use as the key of the element to add.

value ArenaInfo

The object to use as the value of the element to add.

Exceptions

ArgumentNullException

key is null.

ArgumentException

An element with the same key already exists in the IDictionary<TKey, TValue>.

NotSupportedException

The IDictionary<TKey, TValue> is read-only.

Add(KeyValuePair<Address, ArenaInfo>)

Adds an item to the ICollection<T>.

public void Add(KeyValuePair<Address, ArenaInfo> item)

Parameters

item KeyValuePair<Address, ArenaInfo>

The object to add to the ICollection<T>.

Exceptions

NotSupportedException

The ICollection<T> is read-only.

Clear()

Removes all items from the ICollection<T>.

public void Clear()

Exceptions

NotSupportedException

The ICollection<T> is read-only.

Contains(KeyValuePair<Address, ArenaInfo>)

Determines whether the ICollection<T> contains a specific value.

public bool Contains(KeyValuePair<Address, ArenaInfo> item)

Parameters

item KeyValuePair<Address, ArenaInfo>

The object to locate in the ICollection<T>.

Returns

bool

true if item is found in the ICollection<T>; otherwise, false.

ContainsKey(Address)

Determines whether the IDictionary<TKey, TValue> contains an element with the specified key.

public bool ContainsKey(Address key)

Parameters

key Address

The key to locate in the IDictionary<TKey, TValue>.

Returns

bool

true if the IDictionary<TKey, TValue> contains an element with the key; otherwise, false.

Exceptions

ArgumentNullException

key is null.

CopyTo(KeyValuePair<Address, ArenaInfo>[], int)

Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.

public void CopyTo(KeyValuePair<Address, ArenaInfo>[] array, int arrayIndex)

Parameters

array KeyValuePair<Address, ArenaInfo>[]

The one-dimensional Array that is the destination of the elements copied from ICollection<T>. The Array must have zero-based indexing.

arrayIndex int

The zero-based index in array at which copying begins.

Exceptions

ArgumentNullException

array is null.

ArgumentOutOfRangeException

arrayIndex is less than 0.

ArgumentException

The number of elements in the source ICollection<T> is greater than the available space from arrayIndex to the end of the destination array.

DeriveAddress(int)

public static Address DeriveAddress(int index)

Parameters

index int

Returns

Address

End()

public void End()

GetArenaInfo(Address)

public ArenaInfo GetArenaInfo(Address avatarAddress)

Parameters

avatarAddress Address

Returns

ArenaInfo

GetArenaInfos(Address, int, int)

Get arena rank information.

public List<(int rank, ArenaInfo arenaInfo)> GetArenaInfos(Address avatarAddress, int upperRange = 10, int lowerRange = 10)

Parameters

avatarAddress Address

The base value of the range that want to get.

upperRange int

The upper range than base value in the ranges that want to get.

lowerRange int

The lower range than base value in the ranges that want to get.

Returns

List<(int rank, ArenaInfo arenaInfo)>

A list of tuples that contains int and ArenaInfo.

GetArenaInfos(int, int?)

Get arena rank information.

public List<(int rank, ArenaInfo arenaInfo)> GetArenaInfos(int firstRank = 1, int? count = null)

Parameters

firstRank int

The first rank in the range that want to get.

count int?

The count of the range that want to get.

Returns

List<(int rank, ArenaInfo arenaInfo)>

A list of tuples that contains int and ArenaInfo.

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<KeyValuePair<Address, ArenaInfo>> GetEnumerator()

Returns

IEnumerator<KeyValuePair<Address, ArenaInfo>>

An enumerator that can be used to iterate through the collection.

GetObjectData(SerializationInfo, StreamingContext)

Populates a SerializationInfo with the data needed to serialize the target object.

public void GetObjectData(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo

The SerializationInfo to populate with data.

context StreamingContext

The destination (see StreamingContext) for this serialization.

Exceptions

SecurityException

The caller does not have the required permission.

Remove(Address)

Removes the element with the specified key from the IDictionary<TKey, TValue>.

public bool Remove(Address key)

Parameters

key Address

The key of the element to remove.

Returns

bool

true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the original IDictionary<TKey, TValue>.

Exceptions

ArgumentNullException

key is null.

NotSupportedException

The IDictionary<TKey, TValue> is read-only.

Remove(KeyValuePair<Address, ArenaInfo>)

Removes the first occurrence of a specific object from the ICollection<T>.

public bool Remove(KeyValuePair<Address, ArenaInfo> item)

Parameters

item KeyValuePair<Address, ArenaInfo>

The object to remove from the ICollection<T>.

Returns

bool

true if item was successfully removed from the ICollection<T>; otherwise, false. This method also returns false if item is not found in the original ICollection<T>.

Exceptions

NotSupportedException

The ICollection<T> is read-only.

ResetCount(long)

public void ResetCount(long ctxBlockIndex)

Parameters

ctxBlockIndex long

Serialize()

public override IValue Serialize()

Returns

IValue

Set(AvatarState, CharacterSheet)

public void Set(AvatarState avatarState, CharacterSheet characterSheet)

Parameters

avatarState AvatarState
characterSheet CharacterSheet

SetReceive(Address)

public void SetReceive(Address avatarAddress)

Parameters

avatarAddress Address

SetV2(AvatarState, CharacterSheet, CostumeStatSheet)

public void SetV2(AvatarState avatarState, CharacterSheet characterSheet, CostumeStatSheet costumeStatSheet)

Parameters

avatarState AvatarState
characterSheet CharacterSheet
costumeStatSheet CostumeStatSheet

TryGetValue(Address, out ArenaInfo)

Gets the value associated with the specified key.

public bool TryGetValue(Address key, out ArenaInfo value)

Parameters

key Address

The key whose value to get.

value ArenaInfo

When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.

Returns

bool

true if the object that implements IDictionary<TKey, TValue> contains an element with the specified key; otherwise, false.

Exceptions

ArgumentNullException

key is null.

Update(ArenaInfo)

public void Update(ArenaInfo info)

Parameters

info ArenaInfo

Update(WeeklyArenaState, long)

public void Update(WeeklyArenaState prevState, long index)

Parameters

prevState WeeklyArenaState
index long