feat(tabletop): let candidates inherit and override route stacking
Candidates now carry their own stacking strategy, inheriting the route's when absent, so the default tilt applies consistently. Drop the now redundant explicit tilt from the poker deck.
This commit is contained in:
@@ -98,6 +98,22 @@ describe('computeSurfacePlacements', () => {
|
||||
expect(placements[0]!.candidate).toEqual({ seat: '0', x: 40, y: 5, rotation: 1 });
|
||||
});
|
||||
|
||||
it('keeps the candidate stacking alongside its anchor', () => {
|
||||
const surface = makeSurface({
|
||||
layout: [
|
||||
{
|
||||
route: '/dock/:seat',
|
||||
x: 0,
|
||||
y: 0,
|
||||
rotation: 0,
|
||||
candidates: [{ seat: '0', x: 40, y: 5, stacking: { tilt: 2 } }],
|
||||
},
|
||||
],
|
||||
});
|
||||
const placements = computeSurfacePlacements(surface, { '/dock/0': ['harbor:boat#fleet'] });
|
||||
expect(placements[0]!.candidate).toEqual({ seat: '0', x: 40, y: 5, stacking: { tilt: 2 } });
|
||||
});
|
||||
|
||||
it('keeps the same piece on two paths as distinct placements', () => {
|
||||
const surface = makeSurface({
|
||||
layout: [
|
||||
|
||||
Reference in New Issue
Block a user