Table of Contents

Class ObserverBuilder

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

Declares one observer: what region it covers and which archetypes it reaches through.

public sealed class ObserverBuilder
Inheritance
ObserverBuilder
Inherited Members

Remarks

Phase 1 ships World only. The other three are declarable today and refused at Start with the phase that builds them, which is deliberate: the alternative is an API that grows verbs later, so every application written against it has to be revisited when the verb it always wanted finally exists. Declaring the full shape now costs a clear error message and buys a public surface that does not move.

An observer reaches an archetype only if that archetype is spatially indexed. Data with no position — a market, a leaderboard, a player's own inventory — is not something an observer can be pointed at; it travels as a source or as owner fields.

Methods

AroundControlled()

Follows whatever entity the session controls, with no request from the application.

public ObserverBuilder AroundControlled()

Returns

ObserverBuilder

This builder.

At(Vector3D)

Places a sphere at a fixed world position.

public ObserverBuilder At(Vector3D position)

Parameters

position Vector3D

The centre, in world space.

Returns

ObserverBuilder

This builder.

Remarks

It takes a position rather than a pair of horizontal coordinates on purpose: which two axes are "the ground" is the application's convention, not the engine's, and a two-argument overload silently drops the third for anyone whose world is oriented the other way.

Bind(EntityId)

Binds a sphere to an entity, so the region follows it.

public ObserverBuilder Bind(EntityId entity)

Parameters

entity EntityId

The entity to follow.

Returns

ObserverBuilder

This builder.

Budget(int)

Caps the bytes this observer's records may take in one frame.

public ObserverBuilder Budget(int bytes)

Parameters

bytes int

The byte budget.

Returns

ObserverBuilder

This builder.

Far(double, double)

Adds a far tier: per-cell counts per archetype beyond the near tier, at a bounded rate.

public ObserverBuilder Far(double tileM, double maxHz)

Parameters

tileM double

The aggregation tile's edge, in metres.

maxHz double

How often the far tier may be refreshed, in hertz.

Returns

ObserverBuilder

This builder.

Near(int)

Caps the entities this observer's near tier sends; beyond it the near radius shrinks and the rest feeds the far tier.

public ObserverBuilder Near(int budget)

Parameters

budget int

The entity count the near tier is sized for.

Returns

ObserverBuilder

This builder.

Of<TArchetype>()

Adds an archetype this observer reaches. One observer over several archetypes is what lets the engine walk a cell once for many of them.

public ObserverBuilder Of<TArchetype>() where TArchetype : Archetype<TArchetype>

Returns

ObserverBuilder

This builder.

Type Parameters

TArchetype

The archetype.