()
| 68 | } |
| 69 | |
| 70 | public update(): void{ |
| 71 | if(this.getQuestEnded() == false){ |
| 72 | // Test if the player won the quest, if so, end the quest and return |
| 73 | if(this.thePlayerWon()){ |
| 74 | this.endQuest(true); |
| 75 | return; |
| 76 | } |
| 77 | |
| 78 | // Test if the player is dead, if so, end the quest and return |
| 79 | if(this.getGame().getPlayer().shouldDie()){ |
| 80 | this.endQuest(false); |
| 81 | return; |
| 82 | } |
| 83 | |
| 84 | // Update entities |
| 85 | this.updateEntities(); |
| 86 | } |
| 87 | |
| 88 | // Draw |
| 89 | this.preDraw(); |
| 90 | this.drawEntities(); |
| 91 | this.drawAroundQuest(); |
| 92 | if(this.getQuestEnded() == false) this.addExitQuestButton(new CallbackCollection(this.getGame().goToMainMap.bind(this.getGame())), "buttonExitQuestNoKeeping"); |
| 93 | else if(this.getQuestEndedAndWeWon() == false) this.addExitQuestButton(new CallbackCollection(this.getGame().goToMainMap.bind(this.getGame())), "buttonExitQuestNoKeepingBecauseLose"); |
| 94 | else this.addExitQuestButton(new CallbackCollection(this.getGame().goToMainMap.bind(this.getGame())), "buttonExitQuestKeeping"); |
| 95 | this.postDraw(); |
| 96 | } |
| 97 | |
| 98 | // Private methods |
| 99 | private addDeveloperEntity(pos: Pos): void{ |
nothing calls this directly
no test coverage detected