feat(control): spawn session NPCs and resize tokens in preview
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -47,3 +47,15 @@ void test('ScenePlayerTokensSessionStore rotateMapCwSteps', () => {
|
||||
assert.equal(s.byPlayerId.p1?.nx, 0.9);
|
||||
assert.equal(s.byPlayerId.p1?.ny, 0.2);
|
||||
});
|
||||
|
||||
void test('ScenePlayerTokensSessionStore setSize updates placement', () => {
|
||||
const store = new ScenePlayerTokensSessionStore();
|
||||
store.dispatch({ kind: 'setSelection', playerIds: ['p1'] });
|
||||
store.dispatch({ kind: 'show', sizeN: 0.1 });
|
||||
const nxBefore = store.getState().byPlayerId.p1?.nx;
|
||||
const s1 = store.dispatch({ kind: 'setSize', playerId: 'p1', sizeN: 0.22 });
|
||||
assert.equal(s1.byPlayerId.p1?.sizeN, 0.22);
|
||||
assert.equal(s1.byPlayerId.p1?.nx, nxBefore);
|
||||
const s2 = store.dispatch({ kind: 'move', playerId: 'p1', nx: 0.4, ny: 0.5 });
|
||||
assert.equal(s2.byPlayerId.p1?.sizeN, 0.22);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user