Struct CommId
- Namespace
- MarymoorStudios.Core.Rpc
- Assembly
- MarymoorStudios.Core.Rpc.dll
A unique id that represents an object (local or remote) to the channel.
public readonly struct CommId : IEquatable<CommId>
- Implements
- Inherited Members
Remarks
CommIds are unique only within the scope of the MarymoorStudios.Core.Rpc.CommChannel that allocated them. Different MarymoorStudios.Core.Rpc.CommChannels may reuse the same CommIds for different objects.
Constructors
CommId(int)
public CommId(int id)
Parameters
id
int
Properties
Id
The underlying value.
[DataMember]
public int Id { get; }
Property Value
Invalid
The invalid id.
public static CommId Invalid { get; }
Property Value
IsRemote
True if the was allocated by the remote peer.
public bool IsRemote { get; }
Property Value
IsValid
True if the CommId is not Invalid.
public bool IsValid { get; }
Property Value
Methods
Equals(CommId)
Value-based equality.
public bool Equals(CommId other)
Parameters
other
CommId
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
Invert()
Returns the negative reciprocal.
public CommId Invert()
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(CommId, CommId)
Value-based equality.
public static bool operator ==(CommId left, CommId right)
Parameters
Returns
operator ++(CommId)
Return the next id numerically (no wrap-around).
public static CommId operator ++(CommId left)
Parameters
left
CommId
Returns
operator !=(CommId, CommId)
Value-based equality.
public static bool operator !=(CommId left, CommId right)