feat: add gift zone city team and mashup mode

This commit is contained in:
manpengan
2026-03-29 00:49:03 +08:00
parent 5c2b4f40f9
commit 92bf1f5070
12 changed files with 862 additions and 60 deletions

View File

@@ -6,6 +6,7 @@ import {
classifyDeadlock,
evaluateBoard,
generateBoard,
generateMashupBoard,
} from '../js/gameplay/difficulty/index.js'
test('generateBoard is deterministic for the same city, level, and seed', () => {
@@ -72,3 +73,23 @@ test('classifyDeadlock identifies a hard deadlock when slot is full and no match
assert.equal(result.type, 'hard')
})
test('generateMashupBoard is deterministic and mixes unlocked city content', () => {
const contentSystem = createContentSystem()
const first = generateMashupBoard({
cityIds: ['beijing', 'tokyo'],
seed: 33001,
contentSystem,
})
const second = generateMashupBoard({
cityIds: ['beijing', 'tokyo'],
seed: 33001,
contentSystem,
})
assert.deepEqual(first.pieces, second.pieces)
assert.deepEqual(first.overlapGraph, second.overlapGraph)
assert.deepEqual(first.sourceCityIds, ['beijing', 'tokyo'])
assert.ok(new Set(first.elementDefinitions.map((entry) => entry.sourceCityId)).size >= 2)
})