Vixen
02b45cc4
csharp
public interface ISyncField

One piece of a module's state, as the wire sees it.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The whole reason SyncVar gets delta encoding for nothing. A field declares the fixed lanes it occupies, and a module's lanes are its fields' lanes end to end — which is exactly what DeltaCodec needs and exactly what a generated [Replicated] component provides. The two authoring styles meet here rather than in two copies of the encoder.

Fixed-width only. A field whose size depends on its value cannot be part of a lane layout, which is why SyncList`1 is not one of these and travels its own way.

Fields and properties (3)

  • string Name

    What it is called, for bandwidth attribution.

  • ReadOnlySpan<WireLane> Lanes

    The fixed-width fields it occupies, in the order Write puts them.

  • bool IsDirty

    Whether it has changed since the last ClearDirty.

Methods (4)

  • void Write(ref BitWriter writer)

    Writes the value.

  • bool Apply(ref BitReader reader)

    Reads a value and takes it, raising whatever the field raises.

  • void ClearDirty()

    Marks it as sent.

  • void Rename(string name)

    Gives it its name, once it is known which module it is in.

Used by (3)

  • NetworkModuleVixen.Net.Engine
  • SyncStateTestsVixen.Net.Engine.Tests
  • SyncVarVixen.Net.Engine