Expand game engine, replay, tests, and documentation
This commit is contained in:
+9
-5
@@ -127,7 +127,10 @@ describe('Local Operations: drawing (§6.2)', () => {
|
||||
const r = applyIntent(s, 0, { type: 'draw.fromDepartment', slot: 1 });
|
||||
assert.ok(r.ok);
|
||||
assert.ok(s.decks.hands.get(0)!.includes(target));
|
||||
assert.equal(s.decks.departments[1], null);
|
||||
// §6.2 — an emptied Department slot is refilled from the Home Office deck immediately, so the
|
||||
// face-up market never disappears.
|
||||
assert.notEqual(s.decks.departments[1], null, 'Department slot was not refilled');
|
||||
assert.notEqual(s.decks.departments[1], target, 'refilled with the same card');
|
||||
});
|
||||
|
||||
it('allows only one draw per Stage', () => {
|
||||
@@ -200,7 +203,7 @@ describe('Office upgrades (Gap 3b, Gap 8)', () => {
|
||||
// Gap 8 — an upgrade is a PROPERTY change, not a card swap. Swapping would orphan
|
||||
// Secondary Track hanging off the Office.
|
||||
const s = game();
|
||||
addCard(s, at(1, 0), straight());
|
||||
addCard(s, at(-1, 0), straight());
|
||||
const gridBefore = new Map(areaOf(s, 0).grid);
|
||||
const id = handCardOfTier(s, 'depot');
|
||||
applyIntent(s, 0, { type: 'localOps.choose', option: 'draw' });
|
||||
@@ -218,7 +221,8 @@ describe('Office upgrades (Gap 3b, Gap 8)', () => {
|
||||
applyIntent(s, 0, { type: 'card.play', cardId: id });
|
||||
const office = areaOf(s, 0).grid.get(coordKey(areaOf(s, 0).officeCoord))!;
|
||||
assert.equal(office.facility!.porters, 1);
|
||||
assert.equal(office.facility!.capacity.inbound, 2);
|
||||
// The design gives slots equal to porters, not one more.
|
||||
assert.equal(office.facility!.capacity.inbound, 1);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -302,7 +306,7 @@ describe('Local Operations: switching (§6.1, Appendix A)', () => {
|
||||
|
||||
describe('Freight Agent operations (§6.3)', () => {
|
||||
function withFacility(s: GameState): GridCoord {
|
||||
const coord = at(1, 0);
|
||||
const coord = at(-1, 0);
|
||||
addCard(s, coord, {
|
||||
geometry: { kind: 'facility', facility: 'mineTipple' },
|
||||
baseOperationalRail: true,
|
||||
@@ -398,7 +402,7 @@ describe('Freight Agent operations (§6.3)', () => {
|
||||
|
||||
describe('Load/Unload: the four-action freight pipeline (§9.3)', () => {
|
||||
function facilityWithLoad(s: GameState): GridCoord {
|
||||
const coord = at(1, 0);
|
||||
const coord = at(-1, 0);
|
||||
addCard(s, coord, {
|
||||
geometry: { kind: 'facility', facility: 'mineTipple' },
|
||||
baseOperationalRail: true,
|
||||
|
||||
Reference in New Issue
Block a user