()
| 135 | |
| 136 | // Private methods |
| 137 | private checkCandies(): void{ |
| 138 | // Possibly show the eat button |
| 139 | if(this.eatButtonShown == false){ |
| 140 | if(this.getGame().getCandies().getMax() > 0){ |
| 141 | this.eatButtonShown = true; |
| 142 | this.update(); |
| 143 | this.getGame().updatePlace(); |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | // Possibly show the throw button |
| 148 | if(this.throwButtonShown == false){ |
| 149 | if(this.getGame().getCandies().getMax() >= 10){ |
| 150 | this.throwButtonShown = true; |
| 151 | this.update(); |
| 152 | this.getGame().updatePlace(); |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | // Possibly show the request feature button |
| 157 | if(this.requestFeatureButtonShown == false){ |
| 158 | // If we have enough candies & the last feature isn't unlocked yet |
| 159 | if(this.getGame().getCandies().getMax() >= 30 && Saving.loadBool("statusBarUnlockedMap") == false){ |
| 160 | this.requestFeatureButtonShown = true; |
| 161 | this.update(); |
| 162 | this.getGame().updatePlace(); |
| 163 | } |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | private clickedEatCandiesButton(): void{ |
| 168 | if(this.getGame().getCandies().getCurrent() >= 1){ |
no test coverage detected