MCPcopy Create free account
hub / github.com/candybox2/candybox2.github.io / pressedDelete

Method pressedDelete

code/main/TheComputer.ts:305–318  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

303 }
304
305 private pressedDelete(): void{
306 // If we're currently waiting for a command
307 if(this.state == TheComputerState.WAITING_FOR_COMMAND){
308 // If the current command text contains at least one letter
309 if(this.currentCommandText.length > 0){
310 // We delete the last character
311 this.currentCommandText = this.currentCommandText.slice(0, this.currentCommandText.length-1);
312
313 // We update
314 this.update();
315 this.getGame().updatePlace();
316 }
317 }
318 }
319
320 private pressedEnter(): void{
321 // Do something different depending on the current state

Callers

nothing calls this directly

Calls 4

updateMethod · 0.95
sliceMethod · 0.80
updatePlaceMethod · 0.80
getGameMethod · 0.45

Tested by

no test coverage detected