Photon Fusion 2.0.8

Public Member Functions | Properties | List of all members
NetworkDictionaryReadOnly< K, V > Struct Template Reference

A read-only version of NetworkDictionary<TKey,TValue>. More...

Public Member Functions

Get (K key)
 Returns the value for the given key. Will throw an error if the key is not found. More...
 
bool TryGet (K key, out V value)
 Attempts to get the value for a given key. If found, returns true. More...
 

Properties

int Capacity [get]
 The maximum number of entries this dictionary may contain. More...
 
int Count [get]
 Current number of key/value entries in the Dictionary. More...
 

Detailed Description

A read-only version of NetworkDictionary<TKey,TValue>.

Template Parameters
KThe type of the key.
VThe type of the value.

Member Function Documentation

◆ Get()

V Get ( key)

Returns the value for the given key. Will throw an error if the key is not found.

◆ TryGet()

bool TryGet ( key,
out V  value 
)

Attempts to get the value for a given key. If found, returns true.

Parameters
keyThe key to remove.
valueReturns value of removed item. Returns default value if key did not exist.
Returns
Returns true if key was found.

Property Documentation

◆ Capacity

int Capacity
get

The maximum number of entries this dictionary may contain.

◆ Count

int Count
get

Current number of key/value entries in the Dictionary.