Table of Contents

Class Map<T1, T2>

Namespace
Uncreated.Warfare.Util.List
Assembly
Uncreated.Warfare.dll

Two-way dictionary.

public class Map<T1, T2> : IDictionary<T1, T2>, ICollection<KeyValuePair<T1, T2>>, IEnumerable<KeyValuePair<T1, T2>>, IEnumerable

Type Parameters

T1
T2
Inheritance
Map<T1, T2>
Implements
IDictionary<T1, T2>
Inherited Members
Extension Methods

Constructors

Map()

public Map()

Map(int)

public Map(int capacity)

Parameters

capacity int

Map(int, IEqualityComparer<T1>?)

public Map(int capacity, IEqualityComparer<T1>? comparer1)

Parameters

capacity int
comparer1 IEqualityComparer<T1>

Map(int, IEqualityComparer<T1>?, IEqualityComparer<T2>?)

public Map(int capacity, IEqualityComparer<T1>? comparer1, IEqualityComparer<T2>? comparer2)

Parameters

capacity int
comparer1 IEqualityComparer<T1>
comparer2 IEqualityComparer<T2>

Map(int, IEqualityComparer<T2>?)

public Map(int capacity, IEqualityComparer<T2>? comparer2)

Parameters

capacity int
comparer2 IEqualityComparer<T2>

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>.

this[T1]

Gets or sets the element with the specified key.

public T2 this[T1 key] { get; set; }

Parameters

key T1

The key of the element to get or set.

Property Value

T2

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.

this[T2]

public T1 this[T2 key] { get; set; }

Parameters

key T2

Property Value

T1

Methods

Add(T1, T2)

public void Add(T1 item1, T2 item2)

Parameters

item1 T1
item2 T2

Exceptions

ArgumentException

Either key is already in the map.

Clear()

Removes all items from the ICollection<T>.

public void Clear()

Exceptions

NotSupportedException

The ICollection<T> is read-only.

Contains(T1)

public bool Contains(T1 key)

Parameters

key T1

Returns

bool

Contains(T1, T2)

public bool Contains(T1 item1, T2 item2)

Parameters

item1 T1
item2 T2

Returns

bool

Contains(T2)

public bool Contains(T2 key)

Parameters

key T2

Returns

bool

ContainsT1(T1)

public bool ContainsT1(T1 key)

Parameters

key T1

Returns

bool

ContainsT2(T2)

public bool ContainsT2(T2 key)

Parameters

key T2

Returns

bool

Remove(T1)

public bool Remove(T1 key)

Parameters

key T1

Returns

bool

Remove(T2)

public bool Remove(T2 key)

Parameters

key T2

Returns

bool

RemoveT1(T1)

public bool RemoveT1(T1 key)

Parameters

key T1

Returns

bool

RemoveT2(T2)

public bool RemoveT2(T2 key)

Parameters

key T2

Returns

bool

SetOrAdd(T1, T2)

public void SetOrAdd(T1 item1, T2 item2)

Parameters

item1 T1
item2 T2

TryGetValue(T1, out T2)

public bool TryGetValue(T1 key, out T2 value)

Parameters

key T1
value T2

Returns

bool

TryGetValue(T2, out T1)

public bool TryGetValue(T2 key, out T1 value)

Parameters

key T2
value T1

Returns

bool

TryGetValueT1(T1, out T2)

public bool TryGetValueT1(T1 key, out T2 value)

Parameters

key T1
value T2

Returns

bool

TryGetValueT2(T2, out T1)

public bool TryGetValueT2(T2 key, out T1 value)

Parameters

key T2
value T1

Returns

bool