| 539 | |
| 540 | // Public getters |
| 541 | public getForRendering(): string{ |
| 542 | var areaClone: string[] = []; |
| 543 | |
| 544 | // If we have no tags at all |
| 545 | if(this.tags.length == 0){ |
| 546 | // We simply return the area as a string |
| 547 | return this.area.join("\n"); |
| 548 | } |
| 549 | // Else, we have at least one tag |
| 550 | else{ |
| 551 | // We clone the area |
| 552 | areaClone = this.area.slice(0); |
| 553 | |
| 554 | // We add tags to it |
| 555 | for(var i = 0; i < this.height; i++){ |
| 556 | for(var j = 0; j < this.tags[i].length; j++){ |
| 557 | // If the tag should be added, we add it |
| 558 | areaClone[i] = this.tags[i][j].draw(areaClone[i]); |
| 559 | } |
| 560 | } |
| 561 | |
| 562 | // We return the cloned area as a string |
| 563 | return areaClone.join("\n"); |
| 564 | } |
| 565 | } |
| 566 | |
| 567 | public getLine(n: number): string{ |
| 568 | if(n < 0 || n >= this.height) |