Table of Contents

Struct MessageFieldDeclaration

Namespace
Typhon.Protocol
Assembly
Typhon.Protocol.dll

One message field's codec as its attributes declare it: what the generator compiles a ReplicatedMessageAttribute type's CodecAttribute, QuantAttribute and EntityRefAttribute fields into. Engine-free, so a contracts assembly that references only this one carries it; the engine turns it into a codec through the same factories a builder call uses, so it is validated the same.

public readonly struct MessageFieldDeclaration : IEquatable<MessageFieldDeclaration>
Implements
Inherited Members

Constructors

MessageFieldDeclaration(string, CodecKind, int, double, double, double, int, string, bool)

One message field's codec as its attributes declare it: what the generator compiles a ReplicatedMessageAttribute type's CodecAttribute, QuantAttribute and EntityRefAttribute fields into. Engine-free, so a contracts assembly that references only this one carries it; the engine turns it into a codec through the same factories a builder call uses, so it is validated the same.

public MessageFieldDeclaration(string Field, CodecKind Kind, int Bits, double Min, double Max, double Scale, int MaxBytes, string Name, bool Saturate)

Parameters

Field string

The struct field's CLR name.

Kind CodecKind

The codec.

Bits int

Its bits, 0 for its default.

Min double

A Quant's lower bound.

Max double

A Quant's upper bound.

Scale double

A Vec2/3's step.

MaxBytes int

A Str or Blob's cap, or the length of Bytes.

Name string

The wire name, or null for the field's own.

Saturate bool

Whether a value past the codec's range is clamped to it.

Properties

Bits

Its bits, 0 for its default.

public int Bits { get; init; }

Property Value

int

Field

The struct field's CLR name.

public string Field { get; init; }

Property Value

string

Kind

The codec.

public CodecKind Kind { get; init; }

Property Value

CodecKind

Max

A Quant's upper bound.

public double Max { get; init; }

Property Value

double

MaxBytes

A Str or Blob's cap, or the length of Bytes.

public int MaxBytes { get; init; }

Property Value

int

Min

A Quant's lower bound.

public double Min { get; init; }

Property Value

double

Name

The wire name, or null for the field's own.

public string Name { get; init; }

Property Value

string

Saturate

Whether a value past the codec's range is clamped to it.

public bool Saturate { get; init; }

Property Value

bool

Scale

A Vec2/3's step.

public double Scale { get; init; }

Property Value

double

Methods

Deconstruct(out string, out CodecKind, out int, out double, out double, out double, out int, out string, out bool)

public void Deconstruct(out string Field, out CodecKind Kind, out int Bits, out double Min, out double Max, out double Scale, out int MaxBytes, out string Name, out bool Saturate)

Parameters

Field string
Kind CodecKind
Bits int
Min double
Max double
Scale double
MaxBytes int
Name string
Saturate bool

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(MessageFieldDeclaration)

public bool Equals(MessageFieldDeclaration other)

Parameters

other MessageFieldDeclaration

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(MessageFieldDeclaration, MessageFieldDeclaration)

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

Parameters

left MessageFieldDeclaration
right MessageFieldDeclaration

Returns

bool

operator !=(MessageFieldDeclaration, MessageFieldDeclaration)

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

Parameters

left MessageFieldDeclaration
right MessageFieldDeclaration

Returns

bool