(pondLines: PondLine[], pondLineIndex: number)
| 19 | |
| 20 | // Constructor |
| 21 | constructor(pondLines: PondLine[], pondLineIndex: number){ |
| 22 | // Set from the parameters |
| 23 | this.pondLines = pondLines; |
| 24 | this.pondLineIndex = pondLineIndex; |
| 25 | |
| 26 | // Set the orientation (randomly) |
| 27 | this.isLeft = Random.flipACoin(); |
| 28 | |
| 29 | // Set the position (depending on the orientation) |
| 30 | if(this.isLeft == false) // If the lolligator is looking right |
| 31 | this.x = this.pondLines[this.pondLineIndex].getX1(); |
| 32 | else |
| 33 | this.x = this.pondLines[this.pondLineIndex].getX2() - this.width; |
| 34 | |
| 35 | // At first, we're not fully visible |
| 36 | this.visibleType = PondLolligatorVisibleType.NOT_FULLY_VISIBLE_YET; |
| 37 | |
| 38 | // Set isUsed for the pond lines we use |
| 39 | this.setIsUsedForPondLines(true); |
| 40 | } |
| 41 | |
| 42 | // Public methods |
| 43 | public draw(renderArea: RenderArea, x: number, y: number): void{ |
nothing calls this directly
no test coverage detected