Table of Contents

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

int

Invalid

The invalid id.

public static CommId Invalid { get; }

Property Value

CommId

IsRemote

True if the was allocated by the remote peer.

public bool IsRemote { get; }

Property Value

bool

IsValid

True if the CommId is not Invalid.

public bool IsValid { get; }

Property Value

bool

Methods

Equals(CommId)

Value-based equality.

public bool Equals(CommId other)

Parameters

other CommId

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Invert()

Returns the negative reciprocal.

public CommId Invert()

Returns

CommId

ToString()

public override string ToString()

Returns

string

Operators

operator ==(CommId, CommId)

Value-based equality.

public static bool operator ==(CommId left, CommId right)

Parameters

left CommId
right CommId

Returns

bool

operator ++(CommId)

Return the next id numerically (no wrap-around).

public static CommId operator ++(CommId left)

Parameters

left CommId

Returns

CommId

operator !=(CommId, CommId)

Value-based equality.

public static bool operator !=(CommId left, CommId right)

Parameters

left CommId
right CommId

Returns

bool