Skip to main content
Version: 1.x

Class PeerCollection

Intern peer dictionary

Declaration
public class PeerCollection : IReadOnlyCollection<Peer>, IEqualityComparer<Peer>

Implements:
Global.IEqualityComparer<OdinNative.Odin.Peer.Peer>

Properties​

this[ulong]​

Try to get Peer by id

Declaration
public Peer this[ulong key] { get; }

Count​

Count of peers in the collection

Declaration
public int Count { get; }

IsReadOnly​

Indicates whether elements can be added or removed from the collection

Declaration
public bool IsReadOnly { get; }

Methods​

Add(Peer)​

Add a peer to the collection

Declaration
public bool Add(Peer item)
Returns​

System.Boolean: true on success or false

Parameters​
TypeNameDescription
OdinNative.Odin.Peer.Peeritempeer to add

Clear()​

Free and empty the collection

Declaration
public void Clear()

Contains(ulong)​

Determines whether the peer by id is in the collection

Declaration
public bool Contains(ulong id)
Returns​

System.Boolean: true on success or false

Parameters​
TypeNameDescription
System.UInt64idpeer id of the peer

Contains(Peer)​

Determines whether the peer is in the collection

Declaration
public bool Contains(Peer item)
Returns​

System.Boolean: true on success or false

Parameters​
TypeNameDescription
OdinNative.Odin.Peer.Peeritempeer

CopyTo(Peer[], int)​

Copies peers of the collection to an array

Declaration
public void CopyTo(Peer[] array, int arrayIndex)
Parameters​
TypeNameDescription
OdinNative.Odin.Peer.Peer[]arraytarget array
System.Int32arrayIndexarray offset

Equals(Peer, Peer)​

Determines whether the peers are equal

Declaration
public bool Equals(Peer x, Peer y)
Returns​

System.Boolean: true if equal or false

Parameters​
TypeNameDescription
OdinNative.Odin.Peer.Peerxpeer
OdinNative.Odin.Peer.Peerypeer

GetEnumerator()​

Get enumerator for iteration

Declaration
public IEnumerator<Peer> GetEnumerator()
Returns​

Global.IEnumerator<OdinNative.Odin.Peer.Peer>: enumerator### GetHashCode(Peer) Default GetHashCode

Declaration
public int GetHashCode(Peer obj)
Returns​

System.Int32: hash code

Parameters​
TypeNameDescription
OdinNative.Odin.Peer.Peerobjpeer

Remove(ulong)​

Remove a peer by id from the collection

Declaration
public bool Remove(ulong id)
Returns​

System.Boolean: true on success or false

Parameters​
TypeNameDescription
System.UInt64idpeer id of the peer to remove

Remove(Peer)​

Remove a peer from the collection

Declaration
public bool Remove(Peer item)
Returns​

System.Boolean: true on success or false

Parameters​
TypeNameDescription
OdinNative.Odin.Peer.Peeritempeer to remove

Implements​

  • Global.IEqualityComparer<OdinNative.Odin.Peer.Peer>