🧩 Background
Both generateSVG and generateAutoThemeSVG in lib/svg/generator.ts contain a near-identical for loop that builds tower SVG strings. This duplicates ~30 lines of complex geometry logic.
🎯 Objective
Extract the loop body into a buildTowerPaths(towers, accent, autoTheme) helper so each renderer calls one function.
📁 Files to touch
🛠️ Implementation steps
- Create
function buildTowerPaths(towers: TowerData[], accent: string, autoTheme: boolean): string.
- Move the shared loop body into it.
- Call it from both
generateSVG and generateAutoThemeSVG.
✅ Definition of done
🧩 Background
Both
generateSVGandgenerateAutoThemeSVGinlib/svg/generator.tscontain a near-identicalforloop that builds tower SVG strings. This duplicates ~30 lines of complex geometry logic.🎯 Objective
Extract the loop body into a
buildTowerPaths(towers, accent, autoTheme)helper so each renderer calls one function.📁 Files to touch
lib/svg/generator.ts🛠️ Implementation steps
function buildTowerPaths(towers: TowerData[], accent: string, autoTheme: boolean): string.generateSVGandgenerateAutoThemeSVG.✅ Definition of done