Class OwnerBuilder
Declares the fields of an archetype that only the session controlling the entity may see.
public sealed class OwnerBuilder
- Inheritance
-
OwnerBuilder
- Inherited Members
Remarks
A separate section, not a flag on a field. Owner fields have their own change groups and their own bit space, and they travel in SELF; the
public record has no way to address them. That is a structural guarantee rather than a filter someone has to remember to apply — one player's credit
balance cannot reach another player's client by a mistake in the encoder, because the encoder that writes public records cannot name the field.
The names are public even though the values are not. Every client receives the whole catalog, so an owner field's name and codec are visible to everyone. Owner visibility scopes values, never structure.
Methods
Field<TComponent, TField>(Comp<TComponent>, Expression<Func<TComponent, TField>>, Codec, string, string)
An owner-visible field, sent to the controlling session whenever it changes.
public OwnerBuilder Field<TComponent, TField>(Comp<TComponent> component, Expression<Func<TComponent, TField>> selector, Codec codec, string name = null, string group = null) where TComponent : unmanaged
Parameters
componentComp<TComponent>The component handle.
selectorExpression<Func<TComponent, TField>>Selects the field — one member access, resolved once.
codecCodecHow the value travels.
namestringThe wire name. null takes the field's own name.
groupstringThe owner change group. null takes DefaultOwnerGroup.
Returns
- OwnerBuilder
This builder.
Type Parameters
TComponentThe component holding the field.
TFieldThe field's type.
Fraction<TComponent, TValue>(Comp<TComponent>, Expression<Func<TComponent, TValue>>, Expression<Func<TComponent, TValue>>, int, string, string)
The ratio of two fields of one component, owner-visible.
public OwnerBuilder Fraction<TComponent, TValue>(Comp<TComponent> component, Expression<Func<TComponent, TValue>> value, Expression<Func<TComponent, TValue>> max, int bits, string name, string group = null) where TComponent : unmanaged
Parameters
componentComp<TComponent>The component handle.
valueExpression<Func<TComponent, TValue>>Selects the numerator.
maxExpression<Func<TComponent, TValue>>Selects the denominator.
bitsintWidth of the ratio: 8, 16, 24 or 32.
namestringThe wire name. Required.
groupstringThe owner change group. null takes DefaultOwnerGroup.
Returns
- OwnerBuilder
This builder.
Type Parameters
TComponentThe component holding both fields.
TValueThe two fields' type.