game: pin all 48 §2.1 starter pageIds from council-data (#28)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 23:56:12 -05:00
co-authored by Claude Opus 5.5
parent 691fc4a2a3
commit 954bdfcdfc
2 changed files with 55 additions and 5 deletions
+52 -3
View File
@@ -80,8 +80,57 @@ export function starterDeck(seed: number | string): GameCard[] {
type Pin = [cost: number, title: string, faction: Faction, home: Stat];
/** Real pageIds for the shared/catalog.ts cards; the others have none yet (§2.1), see loanerPageId. */
const CATALOG_PAGE_IDS: Record<string, number> = { Moon: 19331, 'Periodic table': 23053, Octopus: 22780, 'Albert Einstein': 736 };
/** Real pageIds for every §2.1 starter card (council-data, docs/game/starter-cards.json `starterDeckPageIds`, #28). */
const CATALOG_PAGE_IDS: Record<string, number> = {
"Moon": 19331,
"Electron": 9476,
"Mars": 14640471,
"Periodic table": 23053,
"Saturn": 44474,
"Photosynthesis": 24544,
"Black hole": 4650,
"Quantum mechanics": 25202,
"Milky Way": 2589714,
"DNA": 7955,
"Sun": 26751,
"Theory of relativity": 30001,
"Octopus": 22780,
"Stonehenge": 27633,
"Axolotl": 235589,
"Rosetta Stone": 26428,
"Coral reef": 87410,
"Roman Empire": 25507,
"Honey bee": 58261,
"Ancient Egypt": 874,
"Amazon rainforest": 48139,
"Blue whale": 4925,
"Great Wall of China": 5094570,
"World War II": 32927,
"Haiku": 13217,
"Ada Lovelace": 974,
"Jazz": 15613,
"Marie Curie": 20408,
"Mona Lisa": 70889,
"Frida Kahlo": 162276,
"Chess": 5134,
"Leonardo da Vinci": 18079,
"The Beatles": 29812,
"William Shakespeare": 32897,
"Olympic Games": 22576,
"Wolfgang Amadeus Mozart": 33163,
"Sputnik 1": 28484,
"Nikola Tesla": 21473,
"Hubble Space Telescope": 40203,
"Isaac Newton": 14627,
"Neil Armstrong": 21247,
"Jupiter": 38930,
"Galileo Galilei": 29688374,
"Albert Einstein": 736,
"International Space Station": 15043,
"Apollo 11": 662,
"Charles Darwin": 8145410,
"Solar System": 26903,
};
export interface StarterDeckDef { id: string; name: string; cards: readonly Pin[] }
@@ -115,7 +164,7 @@ export const STARTER_DECKS: readonly StarterDeckDef[] = [
const kebab = (title: string) => title.toLowerCase().normalize('NFKD').replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');
/** §2.1: the real pageId for the shared/catalog.ts cards, null for the rest (copies then count per cardId). */
/** §2.1: the card's real pageId; null only if council-data has none (copies then count per cardId). */
export function loanerPageId(title: string): number | null {
return Object.hasOwn(CATALOG_PAGE_IDS, title) ? CATALOG_PAGE_IDS[title] : null;
}
+3 -2
View File
@@ -30,12 +30,13 @@ test('starter cards follow §10.1 and the power curve like owned cards', () => {
}
});
test('all 6 factions and all 4 shared/catalog.ts cards (with real pageIds) are covered', () => {
test('all 6 factions covered; every starter card has a real pageId, catalog ones as in shared/catalog.ts', () => {
const all = STARTER_DECKS.flatMap(d => starterDeckById(d.id));
assert.equal(new Set(all.map(c => c.faction)).size, 6);
const ids = Object.fromEntries(all.map(c => [c.title, c.pageId]));
assert.deepEqual([ids.Moon, ids['Periodic table'], ids.Octopus, ids['Albert Einstein']], [19331, 23053, 22780, 736]);
for (const c of all) if (!['Moon', 'Periodic table', 'Octopus', 'Albert Einstein'].includes(c.title)) assert.equal(c.pageId, null, c.title);
for (const c of all) assert.ok(Number.isInteger(c.pageId) && c.pageId! > 0, `${c.title} has a real pageId`);
assert.equal(new Set(all.map(c => c.pageId)).size, all.length, 'no two starter cards share a pageId');
});
test('every starter deck passes engine deck validation and starts a match against every other', () => {