()
| 126 | } |
| 127 | |
| 128 | build(): Pattern { |
| 129 | const output = new Pattern(); |
| 130 | const knittingStyle = this.knittingStyleInput.value() as RowSwitchStyle; |
| 131 | output.rowSwitchStyle = knittingStyle; |
| 132 | |
| 133 | for (let rowIndex = 0; rowIndex < this.lengthInput.numberValue(); |
| 134 | rowIndex++) { |
| 135 | let stitches: Stitch[] = []; |
| 136 | const invertOrder = |
| 137 | knittingStyle === RowSwitchStyles.backAndForth && rowIndex % 2 === 1; |
| 138 | for (let section = 0; section < this.sectionCountInput.numberValue(); |
| 139 | section++) { |
| 140 | const actualSection = invertOrder ? |
| 141 | this.sectionCountInput.numberValue() - section - 1 : |
| 142 | section; |
| 143 | stitches.push(...this.sections[actualSection]!.getStitches( |
| 144 | rowIndex, this.lengthInput.numberValue())); |
| 145 | } |
| 146 | output.addRow(new Row(stitches)); |
| 147 | } |
| 148 | return output; |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | PatternFactoryRegistry.register('Triangles', TrianglesPatternFactory); |
nothing calls this directly
no test coverage detected