(thangsA, thangsB)
| 1404 | } |
| 1405 | |
| 1406 | function layoutsAreEquivalent (thangsA, thangsB) { |
| 1407 | for (let col = 0; col < maxCols; ++col) { |
| 1408 | for (let row = 0; row < maxRows; ++row) { |
| 1409 | const pos = { x: col, y: row } |
| 1410 | let thangA = findThangAt(pos, thangsA) |
| 1411 | let thangB = findThangAt(pos, thangsB) |
| 1412 | if (thangA && floorSpriteNames.includes(thangTypesToSpriteNames[thangA.thangType])) { |
| 1413 | thangA = null |
| 1414 | } |
| 1415 | if (thangB && floorSpriteNames.includes(thangTypesToSpriteNames[thangB.thangType])) { |
| 1416 | thangB = null |
| 1417 | } |
| 1418 | if (!thangA && !thangB) { |
| 1419 | continue |
| 1420 | } |
| 1421 | if (!thangA || !thangB) { |
| 1422 | return false |
| 1423 | } |
| 1424 | if (thangA.thangType !== thangB.thangType) { |
| 1425 | return false |
| 1426 | } |
| 1427 | } |
| 1428 | } |
| 1429 | return true |
| 1430 | } |
| 1431 | |
| 1432 | function processExplosiveChain ({ zapTargetPosSrc, zapTargetPosNew, thangsSrc, thangsNew, processedPositions, visitedPositions, actionSrc, actionNew }) { |
| 1433 | const directions = [ |
no test coverage detected