Struct MessageFieldDeclaration
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
FieldstringThe struct field's CLR name.
KindCodecKindThe codec.
BitsintIts bits, 0 for its default.
MindoubleA
Quant's lower bound.MaxdoubleA
Quant's upper bound.ScaledoubleA
Vec2/3's step.MaxBytesintA
StrorBlob's cap, or the length ofBytes.NamestringThe wire name, or null for the field's own.
SaturateboolWhether 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
Field
The struct field's CLR name.
public string Field { get; init; }
Property Value
Kind
The codec.
public CodecKind Kind { get; init; }
Property Value
Max
A Quant's upper bound.
public double Max { get; init; }
Property Value
MaxBytes
A Str or Blob's cap, or the length of Bytes.
public int MaxBytes { get; init; }
Property Value
Min
A Quant's lower bound.
public double Min { get; init; }
Property Value
Name
The wire name, or null for the field's own.
public string Name { get; init; }
Property Value
Saturate
Whether a value past the codec's range is clamped to it.
public bool Saturate { get; init; }
Property Value
Scale
A Vec2/3's step.
public double Scale { get; init; }
Property Value
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
FieldstringKindCodecKindBitsintMindoubleMaxdoubleScaledoubleMaxBytesintNamestringSaturatebool
Equals(object)
public override bool Equals(object obj)
Parameters
objobject
Returns
Equals(MessageFieldDeclaration)
public bool Equals(MessageFieldDeclaration other)
Parameters
otherMessageFieldDeclaration
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(MessageFieldDeclaration, MessageFieldDeclaration)
public static bool operator ==(MessageFieldDeclaration left, MessageFieldDeclaration right)
Parameters
leftMessageFieldDeclarationrightMessageFieldDeclaration
Returns
operator !=(MessageFieldDeclaration, MessageFieldDeclaration)
public static bool operator !=(MessageFieldDeclaration left, MessageFieldDeclaration right)
Parameters
leftMessageFieldDeclarationrightMessageFieldDeclaration