open-optcg 0.1.0 → 0.2.0-next.2
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.
- package/INTEGRATING.md +245 -0
- package/README.md +3 -0
- package/dist/cards.js +1 -1
- package/dist/chunks/{chunk-4I54H2QI.js → chunk-CRP6FDKG.js} +1 -1
- package/dist/decks.js +2 -2
- package/dist/engine.js +1 -1
- package/dist/types/cards.d.ts +1 -1
- package/dist/types/engine.d.ts +1 -1
- package/dist/types/internal/cards/src/index.d.ts +1 -0
- package/dist/types/internal/decks/src/deck-provenance.d.ts +1 -1
- package/dist/types/internal/decks/src/eb05-robin-tcgmm-manifest.d.ts +2 -0
- package/dist/types/internal/decks/src/index.d.ts +2 -2
- package/dist/types/internal/decks/src/op05-luffy-store-battle-2026-manifest.d.ts +2 -0
- package/dist/types/internal/decks/src/op13-sabo-tcgmm-manifest.d.ts +2 -0
- package/dist/types/internal/decks/src/st30-luffy-ace-cdmx-manifest.d.ts +2 -0
- package/dist/types/internal/engine-core/src/errors.d.ts +2 -2
- package/dist/types/internal/engine-core/src/index.d.ts +1 -1
- package/dist/types/internal/engine-core/src/service.d.ts +11 -0
- package/package.json +3 -2
- package/dist/types/internal/decks/src/eb05-robin-manifest.d.ts +0 -2
- package/dist/types/internal/decks/src/op05-luffy-tournament-manifest.d.ts +0 -2
- package/dist/types/internal/decks/src/op13-sabo-tournament-manifest.d.ts +0 -2
- package/dist/types/internal/decks/src/op17-luffy-ace-manifest.d.ts +0 -2
package/dist/types/cards.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { cardFormatLegality, cardRegistry,
|
|
1
|
+
export { cardFormatLegality, cardRegistry, isStandardLegal, loadPrintedText, parsePrintedTextPack, printedText, registerCards, requireKnownCard, type CardDatabase, type CardDefinition, type CardRecord, } from "./internal/cards/src/index.js";
|
package/dist/types/engine.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { applyAction, createGame, describeStampMismatch, donCountReaders, EngineError, GameService, getLegalActions, hashState, observe, replayActions, RULES_VERSION, rulesStamp, type DonCountReaders, type GameState, type GameTransitionEvent, type ReplayCheckpoint, type ReplayFixture, type RulesStamp, } from "./internal/engine-core/src/index.js";
|
|
1
|
+
export { applyAction, createGame, describeStampMismatch, donCountReaders, EngineError, GameService, getLegalActions, hashState, observe, replayActions, RULES_VERSION, rulesStamp, type DonCountReaders, type GameState, type GameTransitionEvent, type ReplayCheckpoint, type ReplayFixture, type RulesStamp, type SavedGame, } from "./internal/engine-core/src/index.js";
|
|
@@ -41,6 +41,7 @@ export interface CardDatabase {
|
|
|
41
41
|
}
|
|
42
42
|
export declare function createCardDatabase(sets: readonly (readonly CardRecord[])[]): CardDatabase;
|
|
43
43
|
export declare const cards: CardDatabase;
|
|
44
|
+
export declare function registerCards(records: readonly CardRecord[]): void;
|
|
44
45
|
export declare function printedText(cardNumber: string): PrintedText | undefined;
|
|
45
46
|
export declare function clauseText(cardNumber: string, marker: ClauseMarker): string | undefined;
|
|
46
47
|
export declare function counterClauseParts(cardNumber: string): ClauseParts | undefined;
|
|
@@ -12,7 +12,7 @@ export interface DeckCardRow {
|
|
|
12
12
|
}
|
|
13
13
|
export type FormatDeckRowId = (typeof formatDeckManifests)[number]["id"];
|
|
14
14
|
export declare const SECONDARY_SOURCE_ONLY: readonly string[];
|
|
15
|
-
export type CommunityDeckId = "(Blue/Yellow) Nami - Official Feature Deck" | "(Black/Yellow) Marshall.D.Teach - Official Feature Deck" | "(Purple) Enel - Official Feature Deck" | "(Red/Black) Sabo -
|
|
15
|
+
export type CommunityDeckId = "(Blue/Yellow) Nami - Official Feature Deck" | "(Black/Yellow) Marshall.D.Teach - Official Feature Deck" | "(Purple) Enel - Official Feature Deck" | "(Red/Black) Sabo - TCG Match Making EB05 #8" | "(Green) Shanks - Official Feature Deck" | "(Blue) Rocks.D.Xebec - Official Feature Deck" | "(Black) Monkey.D.Luffy - Official Feature Deck" | "(Red) Portgas.D.Ace - Official Feature Deck" | "(Purple) Kaido - Official Feature Deck" | "(Red/Yellow) Jewelry Bonney - Official Feature Deck" | "(Green/Yellow) Yamato - Official Feature Deck" | "(Red) Edward.Newgate - Official Feature Deck" | "(Purple/Yellow) Nico Robin - 2nd Place EU Championship 26-27 S1" | "(Purple) Sengoku - Official Feature Deck" | "(Red/Green) Krieg - Official Feature Deck" | "(Red/Blue) Lucy - Official Feature Deck" | "(Blue) Rebecca - Official Feature Deck" | "(Black) Imu - Official Feature Deck" | "(Red/Purple) Gol.D.Roger - Official Feature Deck" | "(Green/Black) Brook - Official Feature Deck" | "(Yellow) Monkey.D.Luffy - Official Feature Deck" | "(Red/Blue) Nefeltari Vivi - Official Feature Deck" | "(Red) Trafalgar Law - Official Feature Deck" | "(Blue/Yellow) Boa Hancock - Official Feature Deck" | "(Blue) Jinbe - Official Feature Deck" | "(Black) Yamato - Official Feature Deck" | "(Black) Crocodile - Official Feature Deck" | "(Black/Yellow) Gecko Moria - Official Feature Deck" | "(Black/Yellow) Koala - Official Feature Deck" | "(Green/Purple) Monkey.D.Luffy - Official Feature Deck" | "(Green/Yellow) Shirahoshi - Official Feature Deck" | "(Red/Blue) Portgas.D.Ace - Official Feature Deck" | "(Blue/Purple) Sanji - Official Feature Deck" | "(Blue/Black) Usopp - Official Feature Deck" | "(Green) Jinbe - Official Feature Deck" | "(Blue) Buggy - Official Feature Deck" | "(Red) Silvers Rayleigh - Official Feature Deck" | "(Purple) Donquixote Doflamingo - Official Feature Deck" | "(Yellow) Charlotte Linlin - Official Feature Deck" | "(Purple) Kaido - Open OPTCG" | "(Red/Green) Luffy & Ace - 2nd Place CDMX Regional 2026-09-19" | "(Black) Monkey.D.Luffy - Open OPTCG" | "(Red) Portgas.D.Ace - Open OPTCG" | "(Blue) Rocks.D.Xebec - Open OPTCG" | "(Purple/Yellow) Charlotte Pudding - Open OPTCG" | "(Green) Roronoa Zoro - OP17 Post-Ban List" | "(Blue) Kuzan - 1st Place Bandai Hiroshima" | "(Blue/Purple) Vinsmoke Reiju - Top 32 Regional 2025-09-27" | "(Red/Black) Koby - 2nd Place Indonesia Regional Final" | "(Blue/Yellow) Boa Hancock - 25th Place ChinoizeCup #105" | "(Blue) Buggy - 12th Place ChinoizeCup #124" | "(Red) Trafalgar Law - 9th Place ChinoizeCup #125" | "(Green/Yellow) Nico Robin - TCG Match Making EB05 #6" | "(Yellow) Monkey.D.Luffy - 1st Place Store Battle 2026-07-15" | "(Purple) Charlotte Katakuri - 1st Place Store Battle 2026-08-02" | "(Purple) Monkey.D.Luffy - 1st Place Store Battle 2026-09-10" | "(Yellow) Eustass Kid - ChinoizeCup #104" | "(Green/Yellow) Shirahoshi - 3rd Place ChinoizeCup #125" | "(Blue/Purple) Sanji - ChinoizeCup #116" | "(Green/Yellow) Yamato - 1st Place Pirates Party 2026-09-20" | "(Yellow) Vegapunk - 1st Place Store Battle 2026-06-19" | "(Red) Shanks - 1st Place Store Battle 2026-06-29" | "(Red/Purple) Gol.D.Roger - 1st Place OPTCGSim 2026-04-22" | "(Red/Blue) Nefeltari Vivi - 1st Place Store Battle 2026-05-28" | "(Purple) Donquixote Doflamingo - 1st Place Store Battle 2026-01-30" | "(Black/Yellow) Koala - 30th Place ChinoizeCup #113" | "(Black/Yellow) Gecko Moria - 5th Place ChinoizeCup #120" | "(Green) Shanks - 16th Place Rumble League #9" | "(Purple) Enel - 2nd Place ChinoizeCup 2026-08-25" | "(Red) Silvers Rayleigh - 4th Place ChinoizeCup #124" | "(Red/Yellow) Jewelry Bonney - 13th Place ChinoizeCup #104" | "(Blue) Jinbe - 11th Place ChinoizeCup #120" | "(Red/Blue) Portgas.D.Ace - 1st Place OPTCGSim 2026-06-01" | "(Yellow) Enel - TCG Match Making OP17.5 #3" | "(Green/Purple) Monkey.D.Luffy - 1st Place Store Championship 2026-04-25" | "(Green) Jinbe - 1st Place Shop Event 2026-09-16" | "(Purple/Black) Monkey.D.Luffy - 1st Place 2v2 2025-06-13" | "(Red) Monkey.D.Luffy - Open OPTCG" | "(Yellow) Charlotte Linlin - ChinoizeCup #121" | "(Red/Green) Monkey.D.Luffy - Miracle Luffy EB05" | "(Purple) Monkey.D.Luffy - Starter Deck 18" | "(Blue) Ace & Newgate - Starter Deck 22" | "(Red) Shanks - Starter Deck 23" | "(Purple/Black) Monkey.D.Luffy - Starter Deck 26" | "(Black) Marshall.D.Teach - Starter Deck 27" | "(Yellow) Monkey.D.Luffy - Starter Deck 29" | "(Red/Green) Luffy & Ace - Starter Deck 30";
|
|
16
16
|
export declare const COMMUNITY_DECK_IDS: readonly CommunityDeckId[];
|
|
17
17
|
export declare const formatDeckCardRows: readonly DeckCardRow[];
|
|
18
18
|
export declare const communityDeckCardRows: readonly DeckCardRow[];
|
|
@@ -21,7 +21,7 @@ export interface FeaturePageEntry {
|
|
|
21
21
|
posted: string;
|
|
22
22
|
}
|
|
23
23
|
export declare function compareFeaturePageEntries(left: DeckManifest | undefined, right: DeckManifest | undefined): number;
|
|
24
|
-
export declare const TOURNAMENT_DECK_IDS: readonly ["(Blue/Yellow) Nami - Official Feature Deck", "(Black/Yellow) Marshall.D.Teach - Official Feature Deck", "(Purple) Enel - Official Feature Deck", "(Red/Black) Sabo -
|
|
24
|
+
export declare const TOURNAMENT_DECK_IDS: readonly ["(Blue/Yellow) Nami - Official Feature Deck", "(Black/Yellow) Marshall.D.Teach - Official Feature Deck", "(Purple) Enel - Official Feature Deck", "(Red/Black) Sabo - TCG Match Making EB05 #8", "(Green) Shanks - Official Feature Deck", "(Blue) Rocks.D.Xebec - Official Feature Deck", "(Black) Monkey.D.Luffy - Official Feature Deck", "(Red) Portgas.D.Ace - Official Feature Deck", "(Purple) Kaido - Official Feature Deck", "(Green/Yellow) Yamato - Official Feature Deck", "(Red/Yellow) Jewelry Bonney - Official Feature Deck", "(Red) Edward.Newgate - Official Feature Deck", "(Purple) Sengoku - Official Feature Deck", "(Red/Green) Krieg - Official Feature Deck", "(Red/Blue) Lucy - Official Feature Deck", "(Blue) Rebecca - Official Feature Deck", "(Black) Imu - Official Feature Deck", "(Red/Purple) Gol.D.Roger - Official Feature Deck", "(Green/Black) Brook - Official Feature Deck", "(Yellow) Monkey.D.Luffy - Official Feature Deck", "(Red/Blue) Nefeltari Vivi - Official Feature Deck", "(Red) Trafalgar Law - Official Feature Deck", "(Blue/Yellow) Boa Hancock - Official Feature Deck", "(Blue) Jinbe - Official Feature Deck", "(Black) Yamato - Official Feature Deck", "(Black) Crocodile - Official Feature Deck", "(Black/Yellow) Gecko Moria - Official Feature Deck", "(Black/Yellow) Koala - Official Feature Deck", "(Green/Purple) Monkey.D.Luffy - Official Feature Deck", "(Green/Yellow) Shirahoshi - Official Feature Deck", "(Red/Blue) Portgas.D.Ace - Official Feature Deck", "(Blue/Purple) Sanji - Official Feature Deck", "(Blue/Black) Usopp - Official Feature Deck", "(Green) Jinbe - Official Feature Deck", "(Blue) Buggy - Official Feature Deck", "(Red) Silvers Rayleigh - Official Feature Deck", "(Purple) Donquixote Doflamingo - Official Feature Deck", "(Yellow) Charlotte Linlin - Official Feature Deck", "(Purple/Yellow) Nico Robin - 2nd Place EU Championship 26-27 S1", "(Purple) Kaido - Open OPTCG", "(Red/Green) Luffy & Ace - 2nd Place CDMX Regional 2026-09-19", "(Black) Monkey.D.Luffy - Open OPTCG", "(Red) Portgas.D.Ace - Open OPTCG", "(Blue) Rocks.D.Xebec - Open OPTCG", "(Purple/Yellow) Charlotte Pudding - Open OPTCG", "(Green) Roronoa Zoro - OP17 Post-Ban List", "(Blue) Kuzan - 1st Place Bandai Hiroshima", "(Blue/Purple) Vinsmoke Reiju - Top 32 Regional 2025-09-27", "(Red/Black) Koby - 2nd Place Indonesia Regional Final", "(Blue/Yellow) Boa Hancock - 25th Place ChinoizeCup #105", "(Blue) Buggy - 12th Place ChinoizeCup #124", "(Red) Trafalgar Law - 9th Place ChinoizeCup #125", "(Green/Yellow) Nico Robin - TCG Match Making EB05 #6", "(Yellow) Monkey.D.Luffy - 1st Place Store Battle 2026-07-15", "(Purple) Charlotte Katakuri - 1st Place Store Battle 2026-08-02", "(Purple) Monkey.D.Luffy - 1st Place Store Battle 2026-09-10", "(Yellow) Eustass Kid - ChinoizeCup #104", "(Green/Yellow) Shirahoshi - 3rd Place ChinoizeCup #125", "(Blue/Purple) Sanji - ChinoizeCup #116", "(Green/Yellow) Yamato - 1st Place Pirates Party 2026-09-20", "(Yellow) Vegapunk - 1st Place Store Battle 2026-06-19", "(Red) Shanks - 1st Place Store Battle 2026-06-29", "(Red/Purple) Gol.D.Roger - 1st Place OPTCGSim 2026-04-22", "(Red/Blue) Nefeltari Vivi - 1st Place Store Battle 2026-05-28", "(Purple) Donquixote Doflamingo - 1st Place Store Battle 2026-01-30", "(Black/Yellow) Koala - 30th Place ChinoizeCup #113", "(Black/Yellow) Gecko Moria - 5th Place ChinoizeCup #120", "(Green) Shanks - 16th Place Rumble League #9", "(Purple) Enel - 2nd Place ChinoizeCup 2026-08-25", "(Red) Silvers Rayleigh - 4th Place ChinoizeCup #124", "(Red/Yellow) Jewelry Bonney - 13th Place ChinoizeCup #104", "(Blue) Jinbe - 11th Place ChinoizeCup #120", "(Red/Blue) Portgas.D.Ace - 1st Place OPTCGSim 2026-06-01", "(Yellow) Enel - TCG Match Making OP17.5 #3", "(Green/Purple) Monkey.D.Luffy - 1st Place Store Championship 2026-04-25", "(Green) Jinbe - 1st Place Shop Event 2026-09-16", "(Purple/Black) Monkey.D.Luffy - 1st Place 2v2 2025-06-13", "(Red) Monkey.D.Luffy - Open OPTCG", "(Yellow) Charlotte Linlin - ChinoizeCup #121", "(Red/Green) Monkey.D.Luffy - Miracle Luffy EB05"];
|
|
25
25
|
export type TournamentDeckId = (typeof TOURNAMENT_DECK_IDS)[number];
|
|
26
26
|
export interface DeckManifest {
|
|
27
27
|
id: string;
|
|
@@ -33,7 +33,7 @@ export interface DeckManifest {
|
|
|
33
33
|
recommended?: true;
|
|
34
34
|
}
|
|
35
35
|
export declare function deckFormat(manifest: DeckManifest): DeckFormat;
|
|
36
|
-
export declare const SELECTABLE_DECK_IDS: readonly ["(Red) Monkey.D.Luffy - Starter Deck 31", "(Green) Roronoa Zoro - Starter Deck 32", "(Blue) Kuzan - Starter Deck 33", "(Purple) Charlotte Katakuri - Starter Deck 34", "(Red/Black) Sabo - Starter Deck 35", "(Yellow) Eustass Kid - Starter Deck 36", "(Green/Blue) Monkey.D.Luffy - Official Feature Deck", "(Blue/Yellow) Nami - Official Feature Deck", "(Black/Yellow) Marshall.D.Teach - Official Feature Deck", "(Purple) Enel - Official Feature Deck", "(Red/Black) Sabo -
|
|
36
|
+
export declare const SELECTABLE_DECK_IDS: readonly ["(Red) Monkey.D.Luffy - Starter Deck 31", "(Green) Roronoa Zoro - Starter Deck 32", "(Blue) Kuzan - Starter Deck 33", "(Purple) Charlotte Katakuri - Starter Deck 34", "(Red/Black) Sabo - Starter Deck 35", "(Yellow) Eustass Kid - Starter Deck 36", "(Green/Blue) Monkey.D.Luffy - Official Feature Deck", "(Blue/Yellow) Nami - Official Feature Deck", "(Black/Yellow) Marshall.D.Teach - Official Feature Deck", "(Purple) Enel - Official Feature Deck", "(Red/Black) Sabo - TCG Match Making EB05 #8", "(Green) Shanks - Official Feature Deck", "(Blue) Rocks.D.Xebec - Official Feature Deck", "(Black) Monkey.D.Luffy - Official Feature Deck", "(Red) Portgas.D.Ace - Official Feature Deck", "(Purple) Kaido - Official Feature Deck", "(Green/Yellow) Yamato - Official Feature Deck", "(Red/Yellow) Jewelry Bonney - Official Feature Deck", "(Red) Edward.Newgate - Official Feature Deck", "(Purple) Sengoku - Official Feature Deck", "(Red/Green) Krieg - Official Feature Deck", "(Red/Blue) Lucy - Official Feature Deck", "(Blue) Rebecca - Official Feature Deck", "(Black) Imu - Official Feature Deck", "(Red/Purple) Gol.D.Roger - Official Feature Deck", "(Green/Black) Brook - Official Feature Deck", "(Yellow) Monkey.D.Luffy - Official Feature Deck", "(Red/Blue) Nefeltari Vivi - Official Feature Deck", "(Red) Trafalgar Law - Official Feature Deck", "(Blue/Yellow) Boa Hancock - Official Feature Deck", "(Blue) Jinbe - Official Feature Deck", "(Black) Yamato - Official Feature Deck", "(Black) Crocodile - Official Feature Deck", "(Black/Yellow) Gecko Moria - Official Feature Deck", "(Black/Yellow) Koala - Official Feature Deck", "(Green/Purple) Monkey.D.Luffy - Official Feature Deck", "(Green/Yellow) Shirahoshi - Official Feature Deck", "(Red/Blue) Portgas.D.Ace - Official Feature Deck", "(Blue/Purple) Sanji - Official Feature Deck", "(Blue/Black) Usopp - Official Feature Deck", "(Green) Jinbe - Official Feature Deck", "(Blue) Buggy - Official Feature Deck", "(Red) Silvers Rayleigh - Official Feature Deck", "(Purple) Donquixote Doflamingo - Official Feature Deck", "(Yellow) Charlotte Linlin - Official Feature Deck", "(Purple/Yellow) Nico Robin - 2nd Place EU Championship 26-27 S1", "(Purple) Kaido - Open OPTCG", "(Red/Green) Luffy & Ace - 2nd Place CDMX Regional 2026-09-19", "(Black) Monkey.D.Luffy - Open OPTCG", "(Red) Portgas.D.Ace - Open OPTCG", "(Blue) Rocks.D.Xebec - Open OPTCG", "(Purple/Yellow) Charlotte Pudding - Open OPTCG", "(Green) Roronoa Zoro - OP17 Post-Ban List", "(Blue) Kuzan - 1st Place Bandai Hiroshima", "(Blue/Purple) Vinsmoke Reiju - Top 32 Regional 2025-09-27", "(Red/Black) Koby - 2nd Place Indonesia Regional Final", "(Blue/Yellow) Boa Hancock - 25th Place ChinoizeCup #105", "(Blue) Buggy - 12th Place ChinoizeCup #124", "(Red) Trafalgar Law - 9th Place ChinoizeCup #125", "(Green/Yellow) Nico Robin - TCG Match Making EB05 #6", "(Yellow) Monkey.D.Luffy - 1st Place Store Battle 2026-07-15", "(Purple) Charlotte Katakuri - 1st Place Store Battle 2026-08-02", "(Purple) Monkey.D.Luffy - 1st Place Store Battle 2026-09-10", "(Yellow) Eustass Kid - ChinoizeCup #104", "(Green/Yellow) Shirahoshi - 3rd Place ChinoizeCup #125", "(Blue/Purple) Sanji - ChinoizeCup #116", "(Green/Yellow) Yamato - 1st Place Pirates Party 2026-09-20", "(Yellow) Vegapunk - 1st Place Store Battle 2026-06-19", "(Red) Shanks - 1st Place Store Battle 2026-06-29", "(Red/Purple) Gol.D.Roger - 1st Place OPTCGSim 2026-04-22", "(Red/Blue) Nefeltari Vivi - 1st Place Store Battle 2026-05-28", "(Purple) Donquixote Doflamingo - 1st Place Store Battle 2026-01-30", "(Black/Yellow) Koala - 30th Place ChinoizeCup #113", "(Black/Yellow) Gecko Moria - 5th Place ChinoizeCup #120", "(Green) Shanks - 16th Place Rumble League #9", "(Purple) Enel - 2nd Place ChinoizeCup 2026-08-25", "(Red) Silvers Rayleigh - 4th Place ChinoizeCup #124", "(Red/Yellow) Jewelry Bonney - 13th Place ChinoizeCup #104", "(Blue) Jinbe - 11th Place ChinoizeCup #120", "(Red/Blue) Portgas.D.Ace - 1st Place OPTCGSim 2026-06-01", "(Yellow) Enel - TCG Match Making OP17.5 #3", "(Green/Purple) Monkey.D.Luffy - 1st Place Store Championship 2026-04-25", "(Green) Jinbe - 1st Place Shop Event 2026-09-16", "(Purple/Black) Monkey.D.Luffy - 1st Place 2v2 2025-06-13", "(Red) Monkey.D.Luffy - Open OPTCG", "(Yellow) Charlotte Linlin - ChinoizeCup #121", "(Red/Green) Monkey.D.Luffy - Miracle Luffy EB05", "(Purple) Monkey.D.Luffy - Starter Deck 18", "(Blue) Ace & Newgate - Starter Deck 22", "(Red) Shanks - Starter Deck 23", "(Purple/Black) Monkey.D.Luffy - Starter Deck 26", "(Black) Marshall.D.Teach - Starter Deck 27", "(Yellow) Monkey.D.Luffy - Starter Deck 29", "(Red/Green) Luffy & Ace - Starter Deck 30"];
|
|
37
37
|
export type SelectableDeckId = (typeof SELECTABLE_DECK_IDS)[number];
|
|
38
38
|
export declare const DECK_VARIANT_OF: Partial<Record<SelectableDeckId, SelectableDeckId>>;
|
|
39
39
|
export declare function isDeckVariantPair(left: string, right: string): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare class EngineError extends Error {
|
|
2
|
-
readonly code: "STALE_ACTION" | "ILLEGAL_ACTION" | "GAME_FINISHED";
|
|
3
|
-
constructor(code: "STALE_ACTION" | "ILLEGAL_ACTION" | "GAME_FINISHED", message: string);
|
|
2
|
+
readonly code: "STALE_ACTION" | "ILLEGAL_ACTION" | "GAME_FINISHED" | "INCOMPATIBLE_SAVE";
|
|
3
|
+
constructor(code: "STALE_ACTION" | "ILLEGAL_ACTION" | "GAME_FINISHED" | "INCOMPATIBLE_SAVE", message: string);
|
|
4
4
|
}
|
|
@@ -3,7 +3,7 @@ export { applyAction, applyOfferedAction, createGame, getLegalActions, observe,
|
|
|
3
3
|
export { canAttack, counterEventPower, couldAttackThisTurn, hasKeyword, } from "./board.js";
|
|
4
4
|
export type { ResolvedDeck } from "../../protocol/src/index.js";
|
|
5
5
|
export type { ActiveAttack, BoardCard, CardInstance, GameState, RngState, } from "./model.js";
|
|
6
|
-
export { GameService } from "./service.js";
|
|
6
|
+
export { GameService, type SavedGame } from "./service.js";
|
|
7
7
|
export { battleAttackPower, currentPower, donPowerApplies, effectiveCost, recordDeckTopKnowledge, searchRevealIsPublic, } from "./queries.js";
|
|
8
8
|
export { fieldDonCount, returnDonToDeck } from "./don.js";
|
|
9
9
|
export { playCostFromHand } from "./hand-price.js";
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { PlayerId, ResolvedDeck, TimeLimit } from "../../protocol/src/index.js";
|
|
2
2
|
import { type Callback, type GameTransitionEvent } from "./engine.js";
|
|
3
|
+
import type { GameState } from "./model.js";
|
|
4
|
+
import { type RulesStamp } from "./provenance.js";
|
|
3
5
|
import { type Plan, type Simulate } from "./simulate.js";
|
|
6
|
+
export interface SavedGame {
|
|
7
|
+
rules: RulesStamp;
|
|
8
|
+
state: GameState;
|
|
9
|
+
}
|
|
4
10
|
export declare class GameService {
|
|
5
11
|
#private;
|
|
6
12
|
constructor(options?: {
|
|
@@ -19,6 +25,11 @@ export declare class GameService {
|
|
|
19
25
|
simulatorFor(gameId: string, playerId: PlayerId): Simulate;
|
|
20
26
|
plannerFor(gameId: string, playerId: PlayerId): Plan;
|
|
21
27
|
act(gameId: string, revision: number, actionId: string): import("../../protocol/src/index.js").GameObservation;
|
|
28
|
+
save(gameId: string): SavedGame;
|
|
29
|
+
restore(saved: {
|
|
30
|
+
rules?: RulesStamp;
|
|
31
|
+
state: GameState;
|
|
32
|
+
}): import("../../protocol/src/index.js").GameObservation;
|
|
22
33
|
private observeActive;
|
|
23
34
|
private legalActions;
|
|
24
35
|
private requireGame;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "open-optcg",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-next.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
15
|
"dist",
|
|
16
|
-
"README.md"
|
|
16
|
+
"README.md",
|
|
17
|
+
"INTEGRATING.md"
|
|
17
18
|
],
|
|
18
19
|
"description": "A deterministic rules engine for the One Piece Card Game: legal actions, transitions, hidden information and replay.",
|
|
19
20
|
"keywords": [
|