Projection in gamekit looks the same as core:Documentation Index
Fetch the complete documentation index at: https://openturn.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
views.public shapes the observer view, views.player shapes the per-seat view. The only addition is computed: named selectors that are injected as C into moves, permissions, views, and phase configs.
Computed
C:
snapshot.derived.selectors for downstream tools.
Public view
views.public runs once per snapshot. It shapes the observer view; the hosted client uses it for spectator mode, and the local snapshot exposed by useMatch().state returns it when no specific player is selected.
G minus its internal __gamekit bookkeeping.
Player view
views.player runs once per seat per snapshot. It returns the slice that player is allowed to see.
useMatch().state.getPlayerView(playerID).
view.merge and view.computed
For views that mostly repeat computed values, use the helpers:
view.merge(base, context, ...keys) spreads the listed C keys into the base object. view.computed(context, ...keys) is the standalone version when you are not merging.
Don’t store views in G
Same rule as core:G is the source of truth. Views are functions of G. Caching a view inside G creates two representations of the same fact and the engine can only keep one of them in sync. Keep G minimal.
What to read next
- Selectors and player views is the core-level version.
- How-to: model hidden information walks through the battleship pattern.