Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 cycle position #804

Merged
merged 2 commits into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions schema/v2/card_cycles_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
"minLength": 1,
"type": "string"
},
"position": {
"minimum": 0,
"type": "integer"
},
"released_by": {
"enum": ["fantasy_flight_games", "null_signal_games"],
"minLength": 1,
Expand Down
7 changes: 7 additions & 0 deletions test/validate_v1_v2_equality.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ import { expect } from "chai";
describe('Card Cycles v1/v2', () => {
// id in v2 is the textToId'd version of the set name, not the same as the NRDB classic code.
const cyclesByCode = new Map<string, string>();
const positionByLegacyCycleCode = new Map<string, number>();
getCyclesJson().forEach(c => {
cyclesByCode.set(c.code, c.name);
positionByLegacyCycleCode.set(c.code, c.position);
});
const cardCyclesByLegacyCode = new Map<string, string>();
const v2PositionByLegacyCycleCode = new Map<string, number>();
getCardCyclesV2Json().forEach(s => {
cardCyclesByLegacyCode.set(s.legacy_code, s.name);
v2PositionByLegacyCycleCode.set(s.legacy_code, s.position);
});

it('has correct number of cardCycles', () => {
Expand All @@ -31,6 +35,9 @@ describe('Card Cycles v1/v2', () => {
cardCyclesByLegacyCode.forEach((name, legacyCode) => {
expect(cyclesByCode.has(legacyCode), `legacy_code ${legacyCode} exists in packsByCode map`).to.be.true;
expect(name, `name mismatch for card set ${name} with legacy_code ${legacyCode}`).to.equal(cyclesByCode.get(legacyCode));
expect(v2PositionByLegacyCycleCode.get(legacyCode),
`position mismatch for card set ${name} with position ${v2PositionByLegacyCycleCode.get(legacyCode)}`)
.to.equal(positionByLegacyCycleCode.get(legacyCode));
});
});
});
Expand Down
27 changes: 27 additions & 0 deletions v2/card_cycles.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,162 +3,189 @@
"id": "draft",
"legacy_code": "draft",
"name": "Draft",
"position": 0,
"released_by": "fantasy_flight_games"
},
{
"id": "core_set",
"legacy_code": "core",
"name": "Core Set",
"position": 1,
"released_by": "fantasy_flight_games"
},
{
"id": "genesis",
"legacy_code": "genesis",
"name": "Genesis",
"position": 2,
"released_by": "fantasy_flight_games"
},
{
"id": "creation_and_control",
"legacy_code": "creation-and-control",
"name": "Creation and Control",
"position": 3,
"released_by": "fantasy_flight_games"
},
{
"id": "spin",
"legacy_code": "spin",
"name": "Spin",
"position": 4,
"released_by": "fantasy_flight_games"
},
{
"id": "honor_and_profit",
"legacy_code": "honor-and-profit",
"name": "Honor and Profit",
"position": 5,
"released_by": "fantasy_flight_games"
},
{
"id": "lunar",
"legacy_code": "lunar",
"name": "Lunar",
"position": 6,
"released_by": "fantasy_flight_games"
},
{
"id": "order_and_chaos",
"legacy_code": "order-and-chaos",
"name": "Order and Chaos",
"position": 7,
"released_by": "fantasy_flight_games"
},
{
"id": "sansan",
"legacy_code": "sansan",
"name": "SanSan",
"position": 8,
"released_by": "fantasy_flight_games"
},
{
"id": "data_and_destiny",
"legacy_code": "data-and-destiny",
"name": "Data and Destiny",
"position": 9,
"released_by": "fantasy_flight_games"
},
{
"id": "mumbad",
"legacy_code": "mumbad",
"name": "Mumbad",
"position": 10,
"released_by": "fantasy_flight_games"
},
{
"id": "flashpoint",
"legacy_code": "flashpoint",
"name": "Flashpoint",
"position": 11,
"released_by": "fantasy_flight_games"
},
{
"id": "red_sand",
"legacy_code": "red-sand",
"name": "Red Sand",
"position": 12,
"released_by": "fantasy_flight_games"
},
{
"id": "terminal_directive",
"legacy_code": "terminal-directive",
"name": "Terminal Directive",
"position": 13,
"released_by": "fantasy_flight_games"
},
{
"id": "revised_core_set",
"legacy_code": "core2",
"name": "Revised Core Set",
"position": 20,
"released_by": "fantasy_flight_games"
},
{
"id": "kitara",
"legacy_code": "kitara",
"name": "Kitara",
"position": 21,
"released_by": "fantasy_flight_games"
},
{
"id": "reign_and_reverie",
"legacy_code": "reign-and-reverie",
"name": "Reign and Reverie",
"position": 22,
"released_by": "fantasy_flight_games"
},
{
"id": "magnum_opus",
"legacy_code": "magnum-opus",
"name": "Magnum Opus",
"position": 23,
"released_by": "fantasy_flight_games"
},
{
"id": "napd_multiplayer",
"legacy_code": "napd",
"name": "NAPD Multiplayer",
"position": 24,
"released_by": "fantasy_flight_games"
},
{
"id": "system_core_2019",
"legacy_code": "sc19",
"name": "System Core 2019",
"position": 25,
"released_by": "null_signal_games"
},
{
"id": "ashes",
"legacy_code": "ashes",
"name": "Ashes",
"position": 26,
"released_by": "null_signal_games"
},
{
"id": "magnum_opus_reprint",
"legacy_code": "magnum-opus-reprint",
"name": "Magnum Opus Reprint",
"position": 28,
"released_by": "null_signal_games"
},
{
"id": "salvaged_memories",
"legacy_code": "salvaged-memories",
"name": "Salvaged Memories",
"position": 29,
"released_by": "null_signal_games"
},
{
"id": "system_gateway",
"legacy_code": "system-gateway",
"name": "System Gateway",
"position": 30,
"released_by": "null_signal_games"
},
{
"id": "system_update_2021",
"legacy_code": "system-update-2021",
"name": "System Update 2021",
"position": 31,
"released_by": "null_signal_games"
},
{
"id": "borealis",
"legacy_code": "borealis",
"name": "Borealis",
"position": 32,
"released_by": "null_signal_games"
},
{
"id": "liberation",
"legacy_code": "liberation",
"name": "Liberation",
"position": 33,
"released_by": "null_signal_games"
}
]
Loading