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

Method drawStone

code/main/CastleTower.ts:104–122  ·  view source on GitHub ↗
(savingName: string, ourSavingName: string, asciiArtName: string, pos: Pos)

Source from the content-addressed store, hash-verified

102 }
103
104 private drawStone(savingName: string, ourSavingName: string, asciiArtName: string, pos: Pos): void{
105 // If we have the stone but it isn't in the tower yet
106 if(Saving.loadBool(savingName) == true && Saving.loadBool(ourSavingName) == false){
107 // We add the button to click on the stone
108 this.renderArea.addMultipleAsciiButtons("castleTower" + savingName + "Button",
109 pos.x + 3, pos.x + 8, pos.y,
110 pos.x + 2, pos.x + 9, pos.y + 1,
111 pos.x + 1, pos.x + 10, pos.y + 2,
112 pos.x + 2, pos.x + 9, pos.y + 3,
113 pos.x + 3, pos.x + 8, pos.y + 4);
114 // Add the link
115 this.renderArea.addLinkCall(".castleTower" + savingName + "Button", new CallbackCollection(this.clickedOnStone.bind(this, ourSavingName)));
116 }
117 // Else, if we have the stone and it is in the tower
118 else if(Saving.loadBool(savingName) == true && Saving.loadBool(ourSavingName) == true){
119 // We draw the stone ascii art on the specified position
120 this.renderArea.drawArray(Database.getAscii(asciiArtName), pos.x, pos.y-1);
121 }
122 }
123
124 private drawStones(): void{
125 // Calculate the gap

Callers 1

drawStonesMethod · 0.95

Calls 5

addLinkCallMethod · 0.80
bindMethod · 0.80
drawArrayMethod · 0.80
getAsciiMethod · 0.80

Tested by

no test coverage detected