103 lines
3.5 KiB
Markdown

---
sidebar_position: 1
---
# Take Or Gamble Controller
## Index
### Methods
* [_start](#_start) Initializes the take-or-gamble phase depending on game state.
* [_registerEvent](#_registerevent) Registers trigger listeners for take or gamble actions.
* [onTakeClicked](#ontakeclicked) Handles take button click.
* [onGambleClicked](#ongambleclicked) Handles gamble button click.
* [take](#take) Triggers the 'take' action.
* [gamble](#gamble) Triggers the 'gamble' action.
* [checkShowWinLimit](#checkshowwinlimit) Checks whether win limit has been reached and if skipping gamble is disabled.
* [_complete](#_complete) Placeholder for completion handling.
---
## Details
### Methods
#### _start
Initializes the take-or-gamble phase depending on game state.
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/take-or-gamble-controller.js#L16](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/take-or-gamble-controller.js#L16) |
---
#### _registerEvent
Registers trigger listeners for take or gamble actions and win-limit check.
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/take-or-gamble-controller.js#L34](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/take-or-gamble-controller.js#L34) |
---
#### onTakeClicked
Handles take button click.
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/take-or-gamble-controller.js#L47](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/take-or-gamble-controller.js#L47) |
---
#### onGambleClicked
Handles gamble button click.
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/take-or-gamble-controller.js#L57](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/take-or-gamble-controller.js#L57) |
---
#### take
Triggers the 'take' action and notifies with current total win points.
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/take-or-gamble-controller.js#L59](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/take-or-gamble-controller.js#L59) |
---
#### gamble
Triggers the 'gamble' action and notifies with current total win points.
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/take-or-gamble-controller.js#L67](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/take-or-gamble-controller.js#L67) |
---
#### checkShowWinLimit
Checks whether win limit has been reached and if skipping gamble is disabled.
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/take-or-gamble-controller.js#L75](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/take-or-gamble-controller.js#L75) |
---
#### _complete
Placeholder for completion handling.
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/take-or-gamble-controller.js#L80](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/take-or-gamble-controller.js#L80) |