(dev: DeveloperEntity)
| 28 | |
| 29 | // Public methods |
| 30 | public update(dev: DeveloperEntity): void{ |
| 31 | // Iterate over strings |
| 32 | for(var i = 0; i < this.text.length; i++){ |
| 33 | // If there's a character at the current xPos of this string |
| 34 | if(this.xPos < this.text[i].length && this.text[i][this.xPos] != " "){ |
| 35 | // Add a magic ball, depending on the character |
| 36 | switch(this.text[i][this.xPos]){ |
| 37 | case "B": |
| 38 | dev.addMagicBall(this.textPos.plus(new Pos(this.xPos, i)), this.damage, this.timeToLive - this.xPos, ColorType.DEVELOPER_BLUE); |
| 39 | break; |
| 40 | case "Y": |
| 41 | dev.addMagicBall(this.textPos.plus(new Pos(this.xPos, i)), this.damage, this.timeToLive - this.xPos, ColorType.DEVELOPER_YELLOW); |
| 42 | break; |
| 43 | case "O": |
| 44 | dev.addMagicBall(this.textPos.plus(new Pos(this.xPos, i)), this.damage, this.timeToLive - this.xPos, ColorType.DEVELOPER_ORANGE); |
| 45 | break; |
| 46 | } |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | // Increase xPos |
| 51 | this.xPos += 1; |
| 52 | } |
| 53 | } |
nothing calls this directly
no test coverage detected