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

Method setPlace

code/main/Game.ts:354–375  ·  view source on GitHub ↗
(place: Place)

Source from the content-addressed store, hash-verified

352 }
353
354 public setPlace(place: Place): void{
355 // If the current place isn't null, we warn it that we're going to stop displaying it
356 if(this.place != null){
357 this.place.willStopBeingDisplayed();
358 this.resetHotkeys();
359 // If we didn't save this place we're not displaying anymore
360 if(this.savedPlace == null){
361 // It means we're closing it actually, so we tell it that we're closing it
362 this.place.willBeClosed();
363 }
364 }
365
366 // Set the place
367 this.place = place;
368
369 // Callbacks
370 this.resetResourcesCallbacks();
371 this.place.willBeDisplayed();
372
373 // Display the place for the first time
374 this.displayPlace();
375 }
376
377 public unequipIfEquipped(savingName: string, type: EqItemType): void{
378 switch(type){

Callers 15

goToCandyBoxMethod · 0.95
goToCastleMethod · 0.95
goToCastleEntranceMethod · 0.95
goToCauldronMethod · 0.95
goToCfgMethod · 0.95
goToInsideFortressMethod · 0.95
goToInsideYourBoxMethod · 0.95
goToInventoryMethod · 0.95
goToLighthouseMethod · 0.95
goToLollipopFarmMethod · 0.95
goToMainMapMethod · 0.95
goToSaveMethod · 0.95

Calls 6

resetHotkeysMethod · 0.95
displayPlaceMethod · 0.95
willBeClosedMethod · 0.45
willBeDisplayedMethod · 0.45

Tested by

no test coverage detected