(key: string)
| 350 | } |
| 351 | |
| 352 | private pressedKey(key: string): void{ |
| 353 | // If we're currently waiting for a command |
| 354 | if(this.state == TheComputerState.WAITING_FOR_COMMAND){ |
| 355 | // Create an array of words from the current command text (for checking purposes) |
| 356 | var words: string[] = this.currentCommandText.split(" "); |
| 357 | |
| 358 | // If the last word of the current command text isn't too big and the current command text itself isn't too big either |
| 359 | if((words.length == 0 || words[words.length-1].length < 25 || key == " ") && this.currentCommandText.length < 100){ |
| 360 | // We add the letter to the command |
| 361 | this.currentCommandText = this.currentCommandText + key; |
| 362 | |
| 363 | // We update |
| 364 | this.update(); |
| 365 | this.getGame().updatePlace(); |
| 366 | } |
| 367 | } |
| 368 | } |
| 369 | |
| 370 | private switchOnOff(): void{ |
| 371 | // If the computer was on |
nothing calls this directly
no test coverage detected