()
| 30 | |
| 31 | // Public methods |
| 32 | public run(): boolean{ |
| 33 | // To store the return value |
| 34 | var returnValue: boolean = false; |
| 35 | |
| 36 | // If we should exit the game, we return true |
| 37 | if(this.exitGame) |
| 38 | return true; |
| 39 | |
| 40 | // Reset the area |
| 41 | this.getRenderArea().resetAllButSize(); |
| 42 | |
| 43 | // Do something different depending on the step |
| 44 | switch(this.step){ |
| 45 | case GalacticWarsStep.SPLASH_SCREEN: |
| 46 | this.drawSplashScreen(); |
| 47 | returnValue = this.runSplashScreen(); |
| 48 | break; |
| 49 | case GalacticWarsStep.GAME: |
| 50 | this.drawGame(); |
| 51 | returnValue = this.runGame(); |
| 52 | break; |
| 53 | case GalacticWarsStep.LOSE: |
| 54 | this.drawLose(); |
| 55 | returnValue = false; |
| 56 | break; |
| 57 | } |
| 58 | |
| 59 | // We return |
| 60 | return returnValue; |
| 61 | } |
| 62 | |
| 63 | // Private methods |
| 64 | private addAsteroids(): void{ |
nothing calls this directly
no test coverage detected