standings
A championship table that carries over from round to round. `new(opts)` starts one; `add(id, name, meta)` enters someone; `recordRound(results)` scores one round from its finish order and returns that round's scoring and who was eliminated; `rows()` reads the table best first wit…
championshipKit.standings
A championship table that carries over from round to round. new(opts) starts one; add(id, name, meta) enters someone; recordRound(results) scores one round from its finish order and returns that round's scoring and who was eliminated; rows() reads the table best first with place, previous place, points, points gained, per-round places, wins and elimination. encode() / decode() turn the whole table into one string for a synced field.
Ties are settled by wins, then the most second places, then thirds and so on (countback), then the better place in the latest round, then who joined first. Eliminated entrants rank below everyone still in, the later out above the earlier.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
new(opts: Opts?) → any
A new, empty championship. `opts.points` names the points system (see championshipKit.points), `opts.rounds` how many rounds are planned, `opts.eliminate` overrides elimination.
| arg | type | description |
|---|---|---|
| opts | Opts? |
add(id: number, name: string?, meta: string?) → Entrant
Add an entrant (a racer, a player, an AI rival) with 0 points. Adding one who is already in only updates the name and meta. Entrants who join after round 1 have 0 for the rounds they missed.
| arg | type | description |
|---|---|---|
| id | number | |
| name | string? | |
| meta | string? |
isIn(id: number) → boolean
Whether `id` is in the championship and still racing (not eliminated).
| arg | type | description |
|---|---|---|
| id | number |
better(a: Entrant, b: Entrant, roundsSoFar: number) → boolean
| arg | type | description |
|---|---|---|
| a | Entrant | |
| b | Entrant | |
| roundsSoFar | number |
rows( ) → void
The table, best first: { id, name, meta, place, prevPlace, points, gained, places, wins, fastestLaps, eliminated, eliminatedAt }.
recordRound(results: { Finish }) → void
Record one round. `results` lists the round's finishers in finish order (or each with `place`); `dnf = true` scores 0; `fastestLap = true` takes the system's fastest lap bonus. Entrants not listed did not race it. Returns the round's scoring: { { id, name, place, points } } in finish order, plus the id eliminated this round (or nil).
| arg | type | description |
|---|---|---|
| results | { Finish } |
roundsPlayed( ) → number return self
Rounds recorded so far.
podium(n: number?) → void
The top `n` rows (default 3): the podium.
| arg | type | description |
|---|---|---|
| n | number? |
lastRoundResults( ) → void
The scoring of the last round recorded: { { id, name, place, points } } in finish order.
esc(s: string) → string
| arg | type | description |
|---|---|---|
| s | string |
encode( ) → string
The whole championship as one compact string (for a synced field). Championship.decode reads it back.
decode(s: string, opts: Opts?) → any
A championship from a string encode() made. A custom points table is not carried; pass `opts.points` to give it again.
| arg | type | description |
|---|---|---|
| s | string | |
| opts | Opts? |
Entrant = {Opts = {Finish = { id: number, name: string?, meta: string?, place: number?, dnf: boolean?, fastestLap: boolean? }Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.