@crowdedkingdoms/crowdyjs 18.11.0-dev.1 → 18.12.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/MIGRATION.md +26 -0
  2. package/README.md +12 -0
  3. package/dist/generated/graphql-schema.d.ts +2 -2
  4. package/dist/generated/graphql-schema.d.ts.map +1 -1
  5. package/dist/index.d.ts +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/kit/index.d.ts +9 -0
  8. package/dist/kit/index.d.ts.map +1 -1
  9. package/dist/kit/index.js +9 -0
  10. package/dist/kit/kit.d.ts +60 -2
  11. package/dist/kit/kit.d.ts.map +1 -1
  12. package/dist/kit/kit.js +58 -2
  13. package/dist/kit/modules/arenas.d.ts +87 -0
  14. package/dist/kit/modules/arenas.d.ts.map +1 -0
  15. package/dist/kit/modules/arenas.js +66 -0
  16. package/dist/kit/modules/encounters.d.ts +75 -0
  17. package/dist/kit/modules/encounters.d.ts.map +1 -0
  18. package/dist/kit/modules/encounters.js +57 -0
  19. package/dist/kit/modules/instances.d.ts +78 -0
  20. package/dist/kit/modules/instances.d.ts.map +1 -0
  21. package/dist/kit/modules/instances.js +72 -0
  22. package/dist/kit/modules/leaderboards.d.ts +79 -0
  23. package/dist/kit/modules/leaderboards.d.ts.map +1 -0
  24. package/dist/kit/modules/leaderboards.js +69 -0
  25. package/dist/kit/modules/minigames.d.ts +59 -0
  26. package/dist/kit/modules/minigames.d.ts.map +1 -0
  27. package/dist/kit/modules/minigames.js +55 -0
  28. package/dist/kit/modules/racing.d.ts +131 -0
  29. package/dist/kit/modules/racing.d.ts.map +1 -0
  30. package/dist/kit/modules/racing.js +113 -0
  31. package/dist/kit/modules/tables.d.ts +76 -0
  32. package/dist/kit/modules/tables.d.ts.map +1 -0
  33. package/dist/kit/modules/tables.js +73 -0
  34. package/dist/kit/modules/tactics.d.ts +79 -0
  35. package/dist/kit/modules/tactics.d.ts.map +1 -0
  36. package/dist/kit/modules/tactics.js +67 -0
  37. package/dist/kit/modules/territory.d.ts +92 -0
  38. package/dist/kit/modules/territory.d.ts.map +1 -0
  39. package/dist/kit/modules/territory.js +84 -0
  40. package/dist/live-coding/assets/browser-authoring-index.json +1 -1
  41. package/dist/live-coding/assets/manifest.json +1 -1
  42. package/dist/live-coding/browser-authoring-index.generated.d.ts.map +1 -1
  43. package/dist/live-coding/browser-authoring-index.generated.js +3302 -145
  44. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instances.d.ts","sourceRoot":"","sources":["../../../src/kit/modules/instances.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;IAC7C,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oCAAoC;AACpC,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC;IAC9E,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,OAAO,EAAE,MAAM,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IAC/H,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;IAI1B,+CAA+C;IAC/C,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;CAG5B"}
@@ -0,0 +1,72 @@
1
+ import { HubState } from '../mirror.js';
2
+ /** Private runs for one party (the `instance` starter): {@link run} by key. */
3
+ export class InstancesKit {
4
+ constructor(runtime, nodeType = 'instance') {
5
+ this.runtime = runtime;
6
+ this.nodeType = nodeType;
7
+ this.runs = new Map();
8
+ }
9
+ /** The run with key `key` (a key the game makes up, one per run). */
10
+ run(key) {
11
+ let r = this.runs.get(key);
12
+ if (!r) {
13
+ r = new InstanceRun(this.runtime, this.nodeType, key);
14
+ this.runs.set(key, r);
15
+ }
16
+ return r;
17
+ }
18
+ }
19
+ /**
20
+ * One run: a party plays down floors the hub generates from the run's seed, the hub resolves each
21
+ * room, a party with nobody standing is wiped (permadeath), and a run nobody touches expires. A
22
+ * cleared or wiped run posts each member's depth to a leaderboard when the hub's config names one.
23
+ */
24
+ export class InstanceRun {
25
+ constructor(runtime, nodeType, key) {
26
+ this.runtime = runtime;
27
+ this.nodeType = nodeType;
28
+ this.key = key;
29
+ this.view = new HubState(runtime, nodeType, key, 'run');
30
+ }
31
+ watch() {
32
+ return this.view.start();
33
+ }
34
+ unwatch() {
35
+ return this.view.stop();
36
+ }
37
+ /**
38
+ * Opens the run as its owner (a developer kit opens one for `party`); resolves with its seed.
39
+ * @throws {KitError} `started`, `bad_request` (party size), `conflict` (its grid could not be reserved).
40
+ */
41
+ open(options = {}) {
42
+ const args = {};
43
+ if (options.seed !== undefined)
44
+ args.seed = options.seed;
45
+ if (options.party?.length)
46
+ args.party = options.party.map(Number);
47
+ return this.runtime.call(this.nodeType, this.key, 'open', args, { action: true });
48
+ }
49
+ /** The owner invites a player. @throws {KitError} `forbidden`, `full`. */
50
+ invite(player) {
51
+ return this.runtime.call(this.nodeType, this.key, 'invite', { player: Number(player) }, { action: true });
52
+ }
53
+ /** An invited player joins. @throws {KitError} `forbidden`. */
54
+ join() {
55
+ return this.runtime.call(this.nodeType, this.key, 'join', null, { action: true });
56
+ }
57
+ /**
58
+ * Resolves the room the party is at; resolves with what happened, as the log has it.
59
+ * @throws {KitError} `not_member`, `forbidden` (the caller is down), `conflict` (descend first), `finished`.
60
+ */
61
+ enter() {
62
+ return this.runtime.call(this.nodeType, this.key, 'enter', null, { action: true });
63
+ }
64
+ /** The owner leads the party to the next floor; resolves with it. @throws {KitError} `not_ready` (rooms left), `forbidden`. */
65
+ descend() {
66
+ return this.runtime.call(this.nodeType, this.key, 'descend', null, { action: true });
67
+ }
68
+ /** The owner (or a developer) ends the run. */
69
+ abandon() {
70
+ return this.runtime.call(this.nodeType, this.key, 'abandon', null, { action: true });
71
+ }
72
+ }
@@ -0,0 +1,79 @@
1
+ import { HubState } from '../mirror.js';
2
+ import type { KitRuntime } from '../runtime.js';
3
+ /** A player's place on a board. */
4
+ export interface LeaderboardRank {
5
+ rank: number;
6
+ player: number;
7
+ score: number;
8
+ }
9
+ /** What the `board` topic carries: the top of the board and the season. */
10
+ export interface LeaderboardView {
11
+ season: number;
12
+ /** When the season began (Unix ms). */
13
+ season_started: number;
14
+ /** Players with a score this season. */
15
+ entries: number;
16
+ top: LeaderboardRank[];
17
+ }
18
+ /** The season, and the last one's final standings. */
19
+ export interface LeaderboardSeason {
20
+ season: number;
21
+ started: number;
22
+ entries: number;
23
+ last: LeaderboardRank[];
24
+ }
25
+ /** A board's settings (developers). */
26
+ export interface LeaderboardConfig {
27
+ /** `best` (by `order`), `sum` or `latest` submission. */
28
+ keep?: 'best' | 'sum' | 'latest';
29
+ /** `high` scores rank first (points) or `low` (times). */
30
+ order?: 'high' | 'low';
31
+ top_size?: number;
32
+ /** A cron schedule that ends the season (`0 0 * * 1`: every Monday), or null for none. */
33
+ season_cron?: string | null;
34
+ max_entries?: number;
35
+ }
36
+ /** Leaderboards (the `leaderboard` starter): {@link board} by name. */
37
+ export declare class LeaderboardsKit {
38
+ private readonly runtime;
39
+ private readonly nodeType;
40
+ private readonly boards;
41
+ constructor(runtime: KitRuntime, nodeType?: string);
42
+ /** The board named `name` (`weekly-score`, `fastest-lap`, ...). */
43
+ board(name: string): LeaderboardHandle;
44
+ }
45
+ /**
46
+ * One board. The hub ranks players itself, and only other hubs and developers submit: a client
47
+ * never sends its own score, the hub that decided the result does (a session, a race, a run).
48
+ * {@link view} mirrors the `board` topic (at most once a second).
49
+ */
50
+ export declare class LeaderboardHandle {
51
+ private readonly runtime;
52
+ readonly nodeType: string;
53
+ readonly name: string;
54
+ /** The `board` topic: the top of the board and the season. */
55
+ readonly view: HubState<LeaderboardView>;
56
+ constructor(runtime: KitRuntime, nodeType: string, name: string);
57
+ watch(): Promise<LeaderboardView>;
58
+ unwatch(): Promise<void>;
59
+ /** A page of the board, best first. */
60
+ top(options?: {
61
+ limit?: number;
62
+ offset?: number;
63
+ }): Promise<LeaderboardRank[]>;
64
+ /** The places around a player (the caller's own, without `player`). */
65
+ around(options?: {
66
+ player?: number | string;
67
+ radius?: number;
68
+ }): Promise<LeaderboardRank[]>;
69
+ /** The caller's own place, or null without a score this season. */
70
+ me(): Promise<LeaderboardRank | null>;
71
+ season(): Promise<LeaderboardSeason>;
72
+ /** Submits a score for `player`. Developers only (a developer kit); players are refused. */
73
+ submit(player: number | string, score: number): Promise<number>;
74
+ /** Sets the board's config. Developers only. */
75
+ configure(config: LeaderboardConfig): Promise<boolean>;
76
+ /** Ends the season now; resolves with the new season. Developers only. */
77
+ roll(): Promise<number>;
78
+ }
79
+ //# sourceMappingURL=leaderboards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leaderboards.d.ts","sourceRoot":"","sources":["../../../src/kit/modules/leaderboards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,mCAAmC;AACnC,MAAM,WAAW,eAAe;IAC9B,IAAI,E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C,IAAI,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;gBAGtB,OAAO,EAAE,UAAU,EAC3B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM;IAKvB,KAAK,IAAI,OAAO,CAAC,eAAe,CAAC;IAIjC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxB,uCAAuC;IACvC,GAAG,CAAC,OAAO,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAIlF,uEAAuE;IACvE,MAAM,CAAC,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAO/F,mEAAmE;IACnE,EAAE,IAAI,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAIrC,MAAM,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAIpC,4FAA4F;IAC5F,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI/D,gDAAgD;IAChD,SAAS,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAItD,0EAA0E;IAC1E,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;CAGxB"}
@@ -0,0 +1,69 @@
1
+ import { HubState } from '../mirror.js';
2
+ /** Leaderboards (the `leaderboard` starter): {@link board} by name. */
3
+ export class LeaderboardsKit {
4
+ constructor(runtime, nodeType = 'leaderboard') {
5
+ this.runtime = runtime;
6
+ this.nodeType = nodeType;
7
+ this.boards = new Map();
8
+ }
9
+ /** The board named `name` (`weekly-score`, `fastest-lap`, ...). */
10
+ board(name) {
11
+ let b = this.boards.get(name);
12
+ if (!b) {
13
+ b = new LeaderboardHandle(this.runtime, this.nodeType, name);
14
+ this.boards.set(name, b);
15
+ }
16
+ return b;
17
+ }
18
+ }
19
+ /**
20
+ * One board. The hub ranks players itself, and only other hubs and developers submit: a client
21
+ * never sends its own score, the hub that decided the result does (a session, a race, a run).
22
+ * {@link view} mirrors the `board` topic (at most once a second).
23
+ */
24
+ export class LeaderboardHandle {
25
+ constructor(runtime, nodeType, name) {
26
+ this.runtime = runtime;
27
+ this.nodeType = nodeType;
28
+ this.name = name;
29
+ this.view = new HubState(runtime, nodeType, name, 'board');
30
+ }
31
+ watch() {
32
+ return this.view.start();
33
+ }
34
+ unwatch() {
35
+ return this.view.stop();
36
+ }
37
+ /** A page of the board, best first. */
38
+ top(options = {}) {
39
+ return this.runtime.call(this.nodeType, this.name, 'top', options);
40
+ }
41
+ /** The places around a player (the caller's own, without `player`). */
42
+ around(options = {}) {
43
+ const args = {};
44
+ if (options.player !== undefined)
45
+ args.player = Number(options.player);
46
+ if (options.radius !== undefined)
47
+ args.radius = options.radius;
48
+ return this.runtime.call(this.nodeType, this.name, 'around', args);
49
+ }
50
+ /** The caller's own place, or null without a score this season. */
51
+ me() {
52
+ return this.runtime.call(this.nodeType, this.name, 'me');
53
+ }
54
+ season() {
55
+ return this.runtime.call(this.nodeType, this.name, 'season');
56
+ }
57
+ /** Submits a score for `player`. Developers only (a developer kit); players are refused. */
58
+ submit(player, score) {
59
+ return this.runtime.call(this.nodeType, this.name, 'submit', { player: Number(player), score }, { action: true });
60
+ }
61
+ /** Sets the board's config. Developers only. */
62
+ configure(config) {
63
+ return this.runtime.call(this.nodeType, this.name, 'configure', config, { action: true });
64
+ }
65
+ /** Ends the season now; resolves with the new season. Developers only. */
66
+ roll() {
67
+ return this.runtime.call(this.nodeType, this.name, 'roll', null, { action: true });
68
+ }
69
+ }
@@ -0,0 +1,59 @@
1
+ import { HubState } from '../mirror.js';
2
+ import type { KitRuntime } from '../runtime.js';
3
+ export interface DuelSeat {
4
+ player: number;
5
+ wins: number;
6
+ /** Whether this round's throw is in (never which). */
7
+ thrown: boolean;
8
+ }
9
+ export interface DuelReveal {
10
+ round: number;
11
+ /** Each seat's throw, in seat order; null when it was not in on time. */
12
+ hands: Array<string | null>;
13
+ winner: number | null;
14
+ }
15
+ /** What the `duel` topic carries: who has thrown, never what, until the reveal. */
16
+ export interface DuelView {
17
+ phase: 'waiting' | 'playing' | 'finished';
18
+ seats: DuelSeat[];
19
+ best_of: number;
20
+ round: number;
21
+ /** When this round closes (Unix ms). */
22
+ deadline: number | null;
23
+ last: DuelReveal | null;
24
+ winner: number | null;
25
+ }
26
+ /** Two-player duels of hidden throws (the `minigame` starter): {@link duel} by table. */
27
+ export declare class MinigamesKit {
28
+ private readonly runtime;
29
+ private readonly nodeType;
30
+ private readonly duels;
31
+ constructor(runtime: KitRuntime, nodeType?: string);
32
+ duel(key: string): Duel;
33
+ }
34
+ /**
35
+ * One duel: the hub keeps each round's throws until both are in (or the round's time runs out),
36
+ * then reveals them; the first to win a majority of `best_of` rounds wins. The starter's game is
37
+ * rock, paper, scissors.
38
+ */
39
+ export declare class Duel {
40
+ private readonly runtime;
41
+ readonly nodeType: string;
42
+ readonly key: string;
43
+ readonly view: HubState<DuelView>;
44
+ constructor(runtime: KitRuntime, nodeType: string, key: string);
45
+ watch(): Promise<DuelView>;
46
+ unwatch(): Promise<void>;
47
+ /** Takes a seat; resolves with whether this seat started the first round. @throws {KitError} `full`. */
48
+ join(): Promise<boolean>;
49
+ /** Before the duel starts. @throws {KitError} `started`. */
50
+ leave(): Promise<boolean>;
51
+ /**
52
+ * The caller's hidden throw this round; resolves with whether it completed the round.
53
+ * @throws {KitError} `conflict` (already in, or no round open), `bad_request` (not a hand), `not_member`.
54
+ */
55
+ throw(hand: string): Promise<boolean>;
56
+ /** Once it is over: play again. @throws {KitError} `conflict`, `not_member`. */
57
+ rematch(): Promise<boolean>;
58
+ }
59
+ //# sourceMappingURL=minigames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"minigames.d.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AAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;gBAGf,OAAO,EAAE,UAAU,EAC3B,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM;IAKtB,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC;IAI1B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxB,wGAAwG;IACxG,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAIxB,4DAA4D;IAC5D,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC;IAIzB;;;OAGG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIrC,gFAAgF;IAChF,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;CAG5B"}
@@ -0,0 +1,55 @@
1
+ import { HubState } from '../mirror.js';
2
+ /** Two-player duels of hidden throws (the `minigame` starter): {@link duel} by table. */
3
+ export class MinigamesKit {
4
+ constructor(runtime, nodeType = 'minigame') {
5
+ this.runtime = runtime;
6
+ this.nodeType = nodeType;
7
+ this.duels = new Map();
8
+ }
9
+ duel(key) {
10
+ let d = this.duels.get(key);
11
+ if (!d) {
12
+ d = new Duel(this.runtime, this.nodeType, key);
13
+ this.duels.set(key, d);
14
+ }
15
+ return d;
16
+ }
17
+ }
18
+ /**
19
+ * One duel: the hub keeps each round's throws until both are in (or the round's time runs out),
20
+ * then reveals them; the first to win a majority of `best_of` rounds wins. The starter's game is
21
+ * rock, paper, scissors.
22
+ */
23
+ export class Duel {
24
+ constructor(runtime, nodeType, key) {
25
+ this.runtime = runtime;
26
+ this.nodeType = nodeType;
27
+ this.key = key;
28
+ this.view = new HubState(runtime, nodeType, key, 'duel');
29
+ }
30
+ watch() {
31
+ return this.view.start();
32
+ }
33
+ unwatch() {
34
+ return this.view.stop();
35
+ }
36
+ /** Takes a seat; resolves with whether this seat started the first round. @throws {KitError} `full`. */
37
+ join() {
38
+ return this.runtime.call(this.nodeType, this.key, 'join', null, { action: true });
39
+ }
40
+ /** Before the duel starts. @throws {KitError} `started`. */
41
+ leave() {
42
+ return this.runtime.call(this.nodeType, this.key, 'leave', null, { action: true });
43
+ }
44
+ /**
45
+ * The caller's hidden throw this round; resolves with whether it completed the round.
46
+ * @throws {KitError} `conflict` (already in, or no round open), `bad_request` (not a hand), `not_member`.
47
+ */
48
+ throw(hand) {
49
+ return this.runtime.call(this.nodeType, this.key, 'throw', { hand }, { action: true });
50
+ }
51
+ /** Once it is over: play again. @throws {KitError} `conflict`, `not_member`. */
52
+ rematch() {
53
+ return this.runtime.call(this.nodeType, this.key, 'rematch', null, { action: true });
54
+ }
55
+ }
@@ -0,0 +1,131 @@
1
+ import { HubState } from '../mirror.js';
2
+ import type { KitRuntime } from '../runtime.js';
3
+ export interface RaceGate {
4
+ x: number;
5
+ z: number;
6
+ radius: number;
7
+ }
8
+ export interface RaceRacer {
9
+ player: number;
10
+ x: number;
11
+ z: number;
12
+ lap: number;
13
+ /** The gate the racer must pass next. */
14
+ next_gate: number;
15
+ best_lap_ms: number | null;
16
+ place: number | null;
17
+ total_ms: number | null;
18
+ did_not_finish: boolean;
19
+ }
20
+ /** What the `race` topic carries. */
21
+ export interface RaceView {
22
+ phase: 'lobby' | 'countdown' | 'racing' | 'finished';
23
+ course_id: string;
24
+ gates: RaceGate[];
25
+ laps: number;
26
+ /** When the race starts (Unix ms), once counting down. */
27
+ go_at: number | null;
28
+ /** When the rest's time is up, once the winner is in. */
29
+ closes_at: number | null;
30
+ racers: RaceRacer[];
31
+ }
32
+ /** The winner's run: `[ms from the start, x, y, z, yaw]` frames to race against. */
33
+ export interface RaceGhost {
34
+ player: number;
35
+ total_ms: number;
36
+ frames: Array<[number, number, number, number, number]>;
37
+ }
38
+ export interface BallPlayer {
39
+ player: number;
40
+ team: 'red' | 'blue';
41
+ x: number;
42
+ z: number;
43
+ }
44
+ export interface BallState {
45
+ x: number;
46
+ z: number;
47
+ vx: number;
48
+ vz: number;
49
+ holder: number | null;
50
+ held_since: number;
51
+ last_touch: number | null;
52
+ }
53
+ /** What the `ball` topic carries. */
54
+ export interface BallView {
55
+ phase: 'lobby' | 'playing' | 'finished';
56
+ width: number;
57
+ depth: number;
58
+ goal_width: number;
59
+ ball: BallState;
60
+ players: BallPlayer[];
61
+ /** Red's, then blue's. */
62
+ score: [number, number];
63
+ ends_at: number | null;
64
+ winner: 'red' | 'blue' | null;
65
+ }
66
+ /** Races and ball games (the `racing` starter, types `race` and `ball`). */
67
+ export declare class RacingKit {
68
+ private readonly runtime;
69
+ private readonly raceType;
70
+ private readonly ballType;
71
+ private readonly races;
72
+ private readonly matches;
73
+ constructor(runtime: KitRuntime, raceType?: string, ballType?: string);
74
+ /** The race with key `key`. */
75
+ race(key: string): Race;
76
+ /** The ball game with key `key`. */
77
+ ball(key: string): BallMatch;
78
+ }
79
+ /**
80
+ * One race: a course of gates passed in order, a countdown, laps and splits, places in finishing
81
+ * order, and a ghost of the winner's run. A client reports where its racer is ({@link pos}, a few
82
+ * times a second) and the hub times the positions its movement warden kept. `view.onEvent` hears
83
+ * `go`, `timing` (with its `stage`: `started`, `checkpoint`, `lap`, `finished`), `violation` and
84
+ * `finished`.
85
+ */
86
+ export declare class Race {
87
+ private readonly runtime;
88
+ readonly nodeType: string;
89
+ readonly key: string;
90
+ readonly view: HubState<RaceView>;
91
+ constructor(runtime: KitRuntime, nodeType: string, key: string);
92
+ watch(): Promise<RaceView>;
93
+ unwatch(): Promise<void>;
94
+ /** @throws {KitError} `started`, `full`. */
95
+ join(): Promise<boolean>;
96
+ leave(): Promise<boolean>;
97
+ /** Starts the countdown (the first to join, or a developer). @throws {KitError} `forbidden`, `started`. */
98
+ start(): Promise<boolean>;
99
+ /** Reports where the racer is; resolves with the position the hub kept. */
100
+ pos(x: number, z: number): Promise<[number, number]>;
101
+ /** The winner's run, once there is one. */
102
+ ghost(): Promise<RaceGhost | null>;
103
+ }
104
+ /**
105
+ * One ball game: two teams, a ball the hub moves (passes, shots, friction, the side walls),
106
+ * possession (claim a loose ball near it, or take it from an opponent whose protection is over), a
107
+ * goal in each end wall. `view.onEvent` hears `claimed`, `passed`, `shot`, `goal`, `violation` and
108
+ * `finished`.
109
+ */
110
+ export declare class BallMatch {
111
+ private readonly runtime;
112
+ readonly nodeType: string;
113
+ readonly key: string;
114
+ readonly view: HubState<BallView>;
115
+ constructor(runtime: KitRuntime, nodeType: string, key: string);
116
+ watch(): Promise<BallView>;
117
+ unwatch(): Promise<void>;
118
+ /** @throws {KitError} `bad_request` (red or blue), `full`, `started`. */
119
+ join(team: 'red' | 'blue'): Promise<boolean>;
120
+ /** @throws {KitError} `forbidden`, `not_ready` (each team needs a player), `started`. */
121
+ start(): Promise<boolean>;
122
+ /** Reports where the player is; resolves with the position the hub kept. */
123
+ pos(x: number, z: number): Promise<[number, number]>;
124
+ /** Claims the ball. @throws {KitError} `out_of_reach`, `cooldown` (too soon, or its holder's protection), `conflict` (a teammate has it). */
125
+ claim(): Promise<boolean>;
126
+ /** Passes to a teammate. @throws {KitError} `conflict` (not the holder), `bad_request` (not a teammate). */
127
+ pass(to: number | string): Promise<boolean>;
128
+ /** Shoots toward `(x, z)`. @throws {KitError} `conflict` (not the holder). */
129
+ shoot(x: number, z: number): Promise<boolean>;
130
+ }
131
+ //# sourceMappingURL=racing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"racing.d.ts","sourceRoot":"","sources":["../../../src/kit/modules/racing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,G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,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAG9C"}
@@ -0,0 +1,113 @@
1
+ import { HubState } from '../mirror.js';
2
+ /** Races and ball games (the `racing` starter, types `race` and `ball`). */
3
+ export class RacingKit {
4
+ constructor(runtime, raceType = 'race', ballType = 'ball') {
5
+ this.runtime = runtime;
6
+ this.raceType = raceType;
7
+ this.ballType = ballType;
8
+ this.races = new Map();
9
+ this.matches = new Map();
10
+ }
11
+ /** The race with key `key`. */
12
+ race(key) {
13
+ let r = this.races.get(key);
14
+ if (!r) {
15
+ r = new Race(this.runtime, this.raceType, key);
16
+ this.races.set(key, r);
17
+ }
18
+ return r;
19
+ }
20
+ /** The ball game with key `key`. */
21
+ ball(key) {
22
+ let m = this.matches.get(key);
23
+ if (!m) {
24
+ m = new BallMatch(this.runtime, this.ballType, key);
25
+ this.matches.set(key, m);
26
+ }
27
+ return m;
28
+ }
29
+ }
30
+ /**
31
+ * One race: a course of gates passed in order, a countdown, laps and splits, places in finishing
32
+ * order, and a ghost of the winner's run. A client reports where its racer is ({@link pos}, a few
33
+ * times a second) and the hub times the positions its movement warden kept. `view.onEvent` hears
34
+ * `go`, `timing` (with its `stage`: `started`, `checkpoint`, `lap`, `finished`), `violation` and
35
+ * `finished`.
36
+ */
37
+ export class Race {
38
+ constructor(runtime, nodeType, key) {
39
+ this.runtime = runtime;
40
+ this.nodeType = nodeType;
41
+ this.key = key;
42
+ this.view = new HubState(runtime, nodeType, key, 'race');
43
+ }
44
+ watch() {
45
+ return this.view.start();
46
+ }
47
+ unwatch() {
48
+ return this.view.stop();
49
+ }
50
+ /** @throws {KitError} `started`, `full`. */
51
+ join() {
52
+ return this.runtime.call(this.nodeType, this.key, 'join', null, { action: true });
53
+ }
54
+ leave() {
55
+ return this.runtime.call(this.nodeType, this.key, 'leave', null, { action: true });
56
+ }
57
+ /** Starts the countdown (the first to join, or a developer). @throws {KitError} `forbidden`, `started`. */
58
+ start() {
59
+ return this.runtime.call(this.nodeType, this.key, 'start', null, { action: true });
60
+ }
61
+ /** Reports where the racer is; resolves with the position the hub kept. */
62
+ pos(x, z) {
63
+ return this.runtime.call(this.nodeType, this.key, 'pos', { x, z });
64
+ }
65
+ /** The winner's run, once there is one. */
66
+ ghost() {
67
+ return this.runtime.call(this.nodeType, this.key, 'ghost');
68
+ }
69
+ }
70
+ /**
71
+ * One ball game: two teams, a ball the hub moves (passes, shots, friction, the side walls),
72
+ * possession (claim a loose ball near it, or take it from an opponent whose protection is over), a
73
+ * goal in each end wall. `view.onEvent` hears `claimed`, `passed`, `shot`, `goal`, `violation` and
74
+ * `finished`.
75
+ */
76
+ export class BallMatch {
77
+ constructor(runtime, nodeType, key) {
78
+ this.runtime = runtime;
79
+ this.nodeType = nodeType;
80
+ this.key = key;
81
+ this.view = new HubState(runtime, nodeType, key, 'ball');
82
+ }
83
+ watch() {
84
+ return this.view.start();
85
+ }
86
+ unwatch() {
87
+ return this.view.stop();
88
+ }
89
+ /** @throws {KitError} `bad_request` (red or blue), `full`, `started`. */
90
+ join(team) {
91
+ return this.runtime.call(this.nodeType, this.key, 'join', { team }, { action: true });
92
+ }
93
+ /** @throws {KitError} `forbidden`, `not_ready` (each team needs a player), `started`. */
94
+ start() {
95
+ return this.runtime.call(this.nodeType, this.key, 'start', null, { action: true });
96
+ }
97
+ /** Reports where the player is; resolves with the position the hub kept. */
98
+ pos(x, z) {
99
+ return this.runtime.call(this.nodeType, this.key, 'pos', { x, z });
100
+ }
101
+ /** Claims the ball. @throws {KitError} `out_of_reach`, `cooldown` (too soon, or its holder's protection), `conflict` (a teammate has it). */
102
+ claim() {
103
+ return this.runtime.call(this.nodeType, this.key, 'claim', null, { action: true });
104
+ }
105
+ /** Passes to a teammate. @throws {KitError} `conflict` (not the holder), `bad_request` (not a teammate). */
106
+ pass(to) {
107
+ return this.runtime.call(this.nodeType, this.key, 'pass', { to: Number(to) }, { action: true });
108
+ }
109
+ /** Shoots toward `(x, z)`. @throws {KitError} `conflict` (not the holder). */
110
+ shoot(x, z) {
111
+ return this.runtime.call(this.nodeType, this.key, 'shoot', { x, z }, { action: true });
112
+ }
113
+ }