()
| 653 | public update(): void{} |
| 654 | |
| 655 | public updateEntities(): void{ |
| 656 | // We store the current length before calling update stuff |
| 657 | var length: number = this.entities.length; |
| 658 | |
| 659 | // Call the update function on each entity |
| 660 | for(var i = 0; i < length; i++){ |
| 661 | this.entities[i].update(); |
| 662 | } |
| 663 | |
| 664 | // Iterate over entities for removal (the only thing they can't do by themselves..) |
| 665 | for(var i = 0; i < this.entities.length; i++){ |
| 666 | // If the entity should die, we remove it and we make the appropriate callback |
| 667 | if(this.entities[i].shouldDie()){ |
| 668 | this.entities[i].willDie(); |
| 669 | this.entities[i].setDead(true); |
| 670 | this.entities.splice(i, 1); |
| 671 | i--; |
| 672 | } |
| 673 | // Else, if the entity should be removed from the quest because it's out of the view, we remove it |
| 674 | else if(this.entities[i].isOutOfArea()){ |
| 675 | this.entities[i].setOutOfArea(true); |
| 676 | this.entities.splice(i, 1); |
| 677 | i--; |
| 678 | } |
| 679 | } |
| 680 | |
| 681 | // Lower countdowns |
| 682 | this.lowerCountdowns(); |
| 683 | } |
| 684 | |
| 685 | public willBeDisplayed(): void{ |
| 686 | // Some some stuff needed because we start questing |
no test coverage detected