()
| 50 | } |
| 51 | |
| 52 | public update(): void{ |
| 53 | if(this.getQuestEnded() == false){ |
| 54 | // Test if the player won the quest, if so, end the quest and return |
| 55 | if(this.thePlayerWon()){ |
| 56 | this.endQuest(true); |
| 57 | return; |
| 58 | } |
| 59 | |
| 60 | // Test if the player is dead, if so, end the quest and return |
| 61 | if(this.getGame().getPlayer().shouldDie()){ |
| 62 | this.endQuest(false); |
| 63 | return; |
| 64 | } |
| 65 | |
| 66 | // Update entities |
| 67 | this.updateEntities(); |
| 68 | } |
| 69 | |
| 70 | // Draw |
| 71 | this.preDraw(); |
| 72 | this.drawEntities(); |
| 73 | this.drawAroundQuest(); |
| 74 | if(this.getQuestEnded()) this.addExitQuestButton(new CallbackCollection(this.goToFifthHouse.bind(this)), "buttonExitQuestKeeping"); |
| 75 | this.postDraw(); |
| 76 | } |
| 77 | |
| 78 | // Private methods |
| 79 | private addGround(): void{ |
nothing calls this directly
no test coverage detected