235 lines
9.7 KiB
Markdown
235 lines
9.7 KiB
Markdown
---
|
|
sidebar_position: 1
|
|
---
|
|
|
|
# Freerounds Controller
|
|
|
|
## Index
|
|
|
|
### Properties
|
|
|
|
### Methods
|
|
|
|
* [_start](#_start) Initializes freerounds session and presents appropriate dialogs based on state.
|
|
* [_complete](#_complete) Clears timers and unregisters auto-spin deactivation events.
|
|
* [_registerEvent](#_registerevent) Registers relevant network and game events.
|
|
* [presentDialog](#presentdialog) Displays appropriate freerounds dialog based on configuration.
|
|
* [onFreeroundsDataReceived](#onfreeroundsdatareceived) Handles incoming freerounds data and updates model.
|
|
* [onFreeroundsTotalWinPointReceived](#onfreeroundstotalwinpointreceived) Updates model with total win points.
|
|
* [onSelectFreeroundsDataReceived](#onselectfreeroundsdatareceived) Processes selected freerounds data.
|
|
* [onFreeroundsReadyToPlay](#onfreeroundsreadytoplay) Continues the game when ready.
|
|
* [onStartFreeroundsClicked](#onstartfreeroundsclicked) Handles player clicking to start freerounds.
|
|
* [onSkipFreeroundsClicked](#onskipfreeroundsclicked) Skips the current freerounds selection screen.
|
|
* [onHideFreeroundsWinClicked](#onhidefreeroundswinclicked) Finalizes win screen and resets related states.
|
|
* [onAutoSpinActivated](#onautospinactivated) Triggers spin automatically if conditions met.
|
|
* [onSpinClicked](#onspinclicked) Triggers spin on user interaction.
|
|
* [onAutoSpinDeactivated](#onautospindeactivated) Stops any auto-spin delay timers.
|
|
* [selectFreeroundsCompleted](#selectfreeroundscompleted) Finalizes selection and initializes freerounds session.
|
|
* [continue](#continue) Determines game flow after selection or spin completion.
|
|
* [spin](#spin) Executes one spin of the freeround feature.
|
|
|
|
## Details
|
|
|
|
### Properties
|
|
|
|
### Methods
|
|
|
|
#### _start
|
|
|
|
Initializes freerounds session and presents appropriate dialogs based on state
|
|
|
|
| meta | description |
|
|
|:-----|:------------|
|
|
| Defined in | [p4f-slotty-core/src/controller/freerounds-controller.js#L22](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/freerounds-controller.js#L22) |
|
|
|
|
#### _complete
|
|
|
|
Clears timers and unregisters auto-spin deactivation events.
|
|
|
|
| meta | description |
|
|
|:-----|:------------|
|
|
| Defined in | [p4f-slotty-core/src/controller/freerounds-controller.js#L40](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/freerounds-controller.js#L40) |
|
|
|
|
#### _registerEvent
|
|
|
|
Registers relevant network and game events.
|
|
|
|
| meta | description |
|
|
|:-----|:------------|
|
|
| Defined in | [p4f-slotty-core/src/controller/freerounds-controller.js#L47](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/freerounds-controller.js#L47) |
|
|
|
|
#### presentDialog
|
|
|
|
Displays appropriate freerounds dialog based on configuration.
|
|
|
|
| meta | description |
|
|
|:-----|:------------|
|
|
| Defined in | [p4f-slotty-core/src/controller/freerounds-controller.js#L59](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/freerounds-controller.js#L59) |
|
|
|
|
<p style={{ color: 'gray', fontSize: '1.0em' }}>
|
|
|
|
**Parameters**
|
|
* `freeroundsData` [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
|
|
* `spinPlayed` [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
|
|
|
* `allowChangeOptions` [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)
|
|
</p>
|
|
|
|
#### onFreeroundsDataReceived
|
|
|
|
Handles incoming freerounds data and updates model.
|
|
|
|
| meta | description |
|
|
|:-----|:------------|
|
|
| Defined in | [p4f-slotty-core/src/controller/freerounds-controller.js#L83](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/freerounds-controller.js#L83) |
|
|
|
|
<p style={{ color: 'gray', fontSize: '1.0em' }}>
|
|
|
|
**Parameters**
|
|
* `data` [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
|
|
* `spinLeft` [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
|
* `freeroundsID` [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
|
</p>
|
|
|
|
#### onFreeroundsTotalWinPointReceived
|
|
|
|
Updates model with total win points.
|
|
|
|
| meta | description |
|
|
|:-----|:------------|
|
|
| Defined in | [p4f-slotty-core/src/controller/freerounds-controller.js#L98](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/freerounds-controller.js#L98) |
|
|
|
|
<p style={{ color: 'gray', fontSize: '1.0em' }}>
|
|
|
|
**Parameters**
|
|
|
|
`totalWinPoint` [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
|
|
|
</p>
|
|
|
|
#### onSelectFreeroundsDataReceived
|
|
|
|
Processes selected freerounds data.
|
|
|
|
| meta | description |
|
|
|:-----|:------------|
|
|
| Defined in | [p4f-slotty-core/src/controller/freerounds-controller.js#L106](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/freerounds-controller.js#L106) |
|
|
|
|
<p style={{ color: 'gray', fontSize: '1.0em' }}>
|
|
|
|
**Parameters**
|
|
|
|
`data` [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
|
|
</p>
|
|
|
|
#### onFreeroundsReadyToPlay
|
|
|
|
Continues the game when ready.
|
|
|
|
| meta | description |
|
|
|:-----|:------------|
|
|
| Defined in | [p4f-slotty-core/src/controller/freerounds-controller.js#L114](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/freerounds-controller.js#L114) |
|
|
|
|
<p style={{ color: 'gray', fontSize: '1.0em' }}>
|
|
|
|
**Parameters**
|
|
|
|
`data` [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
|
|
</p>
|
|
|
|
#### onStartFreeroundsClicked
|
|
|
|
Handles player clicking to start freerounds.
|
|
|
|
| meta | description |
|
|
|:-----|:------------|
|
|
| Defined in | [p4f-slotty-core/src/controller/freerounds-controller.js#L122](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/freerounds-controller.js#L122) |
|
|
|
|
<p style={{ color: 'gray', fontSize: '1.0em' }}>
|
|
|
|
**Parameters**
|
|
|
|
`optionIndex` [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
|
|
|
</p>
|
|
|
|
#### onSkipFreeroundsClicked
|
|
|
|
Skips the current freerounds selection screen.
|
|
|
|
| meta | description |
|
|
|:-----|:------------|
|
|
| Defined in | [p4f-slotty-core/src/controller/freerounds-controller.js#L136](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/freerounds-controller.js#L136) |
|
|
|
|
#### onHideFreeroundsWinClicked
|
|
|
|
Finalizes win screen and resets related states.
|
|
|
|
| meta | description |
|
|
|:-----|:------------|
|
|
| Defined in | [p4f-slotty-core/src/controller/freerounds-controller.js#L145](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/freerounds-controller.js#L145) |
|
|
|
|
#### onAutoSpinActivated
|
|
|
|
Triggers spin automatically if conditions met.
|
|
|
|
| meta | description |
|
|
|:-----|:------------|
|
|
| Defined in | [p4f-slotty-core/src/controller/freerounds-controller.js#L164](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/freerounds-controller.js#L164) |
|
|
|
|
#### onSpinClicked
|
|
|
|
Triggers spin on user interaction.
|
|
|
|
| meta | description |
|
|
|:-----|:------------|
|
|
| Defined in | [p4f-slotty-core/src/controller/freerounds-controller.js#L172](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/freerounds-controller.js#L172) |
|
|
|
|
#### onAutoSpinDeactivated
|
|
|
|
Stops any auto-spin delay timers.
|
|
|
|
| meta | description |
|
|
|:-----|:------------|
|
|
| Defined in | [p4f-slotty-core/src/controller/freerounds-controller.js#L180](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/freerounds-controller.js#L180) |
|
|
|
|
#### selectFreeroundsCompleted
|
|
|
|
Finalizes selection and initializes freerounds session.
|
|
|
|
| meta | description |
|
|
|:-----|:------------|
|
|
| Defined in | [p4f-slotty-core/src/controller/freerounds-controller.js#L191](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/freerounds-controller.js#L191) |
|
|
|
|
<p style={{ color: 'gray', fontSize: '1.0em' }}>
|
|
|
|
**Parameters**
|
|
* `freeroundsData` [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
|
|
* `freeroundsID` [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
|
* `spinCount` [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
|
* `betPoint` [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
|
* `spinPlayed` [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
|
|
|
</p>
|
|
|
|
#### continue
|
|
|
|
Determines game flow after selection or spin completion.
|
|
|
|
| meta | description |
|
|
|:-----|:------------|
|
|
| Defined in | [p4f-slotty-core/src/controller/freerounds-controller.js#L214](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/freerounds-controller.js#L214) |
|
|
|
|
#### spin
|
|
|
|
Executes one spin of the freeround feature.
|
|
|
|
| meta | description |
|
|
|:-----|:------------|
|
|
| Defined in | [p4f-slotty-core/src/controller/freerounds-controller.js#L227](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/freerounds-controller.js#L227) |
|