Photon Fusion 2.0.0

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

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

Public Member Functions

int Find (K key)
 
Get (K key)
 Returns the value for the given key. Will throw an error if the key is not found.
 
uint GetBucketFromHashCode (int hash)
 
GetKey (int entry)
 
int GetNxt (int entry)
 
GetVal (int entry)
 
bool TryGet (K key, out V value)
 Attempts to get the value for a given key. If found, returns true.
 

Public Attributes

readonly int _bucketsOffset
 
readonly int _capacity
 
readonly int * _data
 
readonly int _entriesOffset
 
readonly int _entryStride
 
readonly EqualityComparer< K > _equalityComparer
 
readonly int _keyOffset
 
readonly IElementReaderWriter< K > _keyReaderWriter
 
readonly int _nxtOffset
 
readonly int _valOffset
 
readonly IElementReaderWriter< V > _valReaderWriter
 

Static Public Attributes

const int FREE_COUNT_OFFSET = 1
 
const int FREE_OFFSET = 0
 
const int INVALID_ENTRY = 0
 
const int USED_COUNT_OFFSET = 2
 

Properties

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

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

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