(renderArea: RenderArea)
| 178 | } |
| 179 | |
| 180 | public draw(renderArea: RenderArea): void{ |
| 181 | if(this.renderArea != null){ |
| 182 | // On some conditions, we exit now and don't draw anything (it allows no drawing outside of the quest panel when realQuestSize and realQuestDrawingSize are different (in the hole for example) |
| 183 | if(this.globalPosition.x + this.renderAreaPosition.x + this.quest.getGlobalDrawingOffset().x > this.quest.getRealQuestDrawingSize().x) |
| 184 | return; |
| 185 | if(this.globalPosition.y + this.renderAreaPosition.y + this.quest.getGlobalDrawingOffset().y > this.quest.getRealQuestDrawingSize().y) |
| 186 | return; |
| 187 | if(this.globalPosition.x + this.renderAreaPosition.x + this.renderArea.getWidth() + this.quest.getGlobalDrawingOffset().x < 0) |
| 188 | return; |
| 189 | if(this.globalPosition.y + this.renderAreaPosition.y + this.renderArea.getHeight() + this.quest.getGlobalDrawingOffset().y < 0) |
| 190 | return; |
| 191 | |
| 192 | renderArea.drawArea(this.renderArea, this.quest.getRealQuestPosition().x + this.quest.getGlobalDrawingOffset().x + this.globalPosition.x + this.renderAreaPosition.x, this.quest.getRealQuestPosition().y + this.quest.getGlobalDrawingOffset().y + this.globalPosition.y + this.renderAreaPosition.y, this.transparency); |
| 193 | } |
| 194 | |
| 195 | // If the debug mode is on |
| 196 | if(Saving.loadBool("gameDebug")){ |
| 197 | if(this.cbc != null){ |
| 198 | for(var i = 0; i < this.cbc.getBoxes().length; i++){ |
| 199 | for(var k = 0; k < this.cbc.getBoxes()[i].getSize().x; k++){ |
| 200 | for(var j = 0; j < this.cbc.getBoxes()[i].getSize().y; j++){ |
| 201 | renderArea.drawString("D", this.quest.getRealQuestPosition().x + this.quest.getGlobalDrawingOffset().x + this.globalPosition.x + this.cbc.getBoxes()[i].getPosition().x + k, this.quest.getRealQuestPosition().y + this.quest.getGlobalDrawingOffset().y + this.globalPosition.y + this.cbc.getBoxes()[i].getPosition().y + j); |
| 202 | } |
| 203 | } |
| 204 | } |
| 205 | } |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | public forceMoving(movement: Pos): void{ |
| 210 | if(this.canBeForcedToMove) |
no test coverage detected