v0.4.0 — multiplayer Phases 0 and 1: seat and player split apart, turn state per player, the page behind a Session, and eight seat/player mix-ups fixed with tests that fail without them

This commit is contained in:
Jesse
2026-08-13 14:06:02 -04:00
parent 216006b091
commit 49f8504b05
34 changed files with 1743 additions and 526 deletions
+5 -5
View File
@@ -14,7 +14,7 @@ import { applyIntent, areaOf, check } from '../src/engine/apply.ts';
import { ALL_TRAINS, trainProfile } from '../src/engine/content.ts';
import { createGame } from '../src/engine/setup.ts';
import type { GameConfig, GameState, GridCoord, RollingStock, TrackCard } from '../src/engine/state.ts';
import { coordKey } from '../src/engine/state.ts';
import { coordKey, turnOf } from '../src/engine/state.ts';
import { trainRules } from '../src/sim/view.ts';
const config: GameConfig = {
@@ -54,12 +54,12 @@ function switching(
area.grid.set(coordKey({ row: office.row, col: office.col - 3 }), straight());
s.trays.set('t', {
id: 't', trainNumber, trainIsExtra: isExtra, engineAt: 0, consist,
direction: 'west', facing: 'w', position: { at: 'grid', owner: 0, coord: here }, movesUsed: 0,
direction: 'west', facing: 'w', position: { at: 'grid', seat: 0, coord: here }, movesUsed: 0,
});
s.clock.phase = 'localOps';
s.clock.currentActor = 0;
s.turn.option = 'switch';
s.turn.movesRemaining = 6;
turnOf(s, 0).option = 'switch';
turnOf(s, 0).movesRemaining = 6;
return 't';
}
@@ -210,7 +210,7 @@ describe('§7 — trains Porters may not work', () => {
};
s.trays.set('t', {
id: 't', trainNumber, trainIsExtra: isExtra, engineAt: 0, consist: [coach(false)],
direction: 'east', position: { at: 'grid', owner: 0, coord: area.officeCoord }, movesUsed: 0,
direction: 'east', position: { at: 'grid', seat: 0, coord: area.officeCoord }, movesUsed: 0,
});
area.adOccupancy.push('t');
s.clock.phase = 'loadUnload';