Merge branch 'develop' into feature/add-doc-bonus-game

This commit is contained in:
Pham Huynh Duc Huy 2025-07-18 10:28:20 +08:00
commit 3048a4246a
14 changed files with 420 additions and 25 deletions

View File

@ -6,7 +6,7 @@ sidebar_position: 0
# Slot Game API
## Slot Game Machine
* [Initialize](slot-machine/initialize-controller)
* [Initialize](category/initialize)
* [Balance](category/balance)
* [Bet](category/bet)
* [Spin](category/spin)

View File

@ -1,5 +1,5 @@
{
"position": 5,
"position": 15,
"label": "Auto Spin",
"collapsible": true,
"collapsed": true,

View File

@ -6,8 +6,8 @@ sidebar_position: 1
## Index
### Properties
* [savedCurrentPoint](#savedcurrentpoint) `Number` Current played bet.
* [savedFreePoint](#savedfreepoint) `Number` Current free point played bet.
* [savedCurrentPoint](#savedcurrentpoint) `Number` The current played bet.
* [savedFreePoint](#savedfreepoint) `Number` The current free point played bet.
* [isResume](#isresume) `Boolean` Indicates whether the game current state is resuming.
### Methods
@ -33,7 +33,7 @@ sidebar_position: 1
## Details
#### savedCurrentPoint
> Current played bet.<br/>
> The current played bet.<br/>
| meta | description |
| :--- | :---------- |
@ -41,7 +41,7 @@ sidebar_position: 1
| Defined in | [p4f-game-core/src/controller/balance-controller.js:12](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/controller/balance-controller.js#L12)|
#### savedFreePoint
> Current free point played bet.<br/>
> The current free point played bet.<br/>
| meta | description |
| :--- | :---------- |

View File

@ -7,21 +7,21 @@ sidebar_position: 2
## Index
### Properties
* [currentPoint](#currentpoint) `Number` Current point.
* [freePoint](#freepoint) `Number` Current free point.
* [currentPoint](#currentpoint) `Number` The current point.
* [freePoint](#freepoint) `Number` The current free point.
### Methods
* [SetCurrentPoint](#setcurrentpoint) Set current point.
* [GetCurrentPoint](#getcurrentpoint) Get current point.
* [SetFreePoint](#setfreepoint) Set current free point.
* [GetFreePoint](#getfreepoint) Get current free point.
* [GetAvailablePoint](#getavalablepoint) Get current point.
* [SetCurrentPoint](#setcurrentpoint) Set the current point.
* [GetCurrentPoint](#getcurrentpoint) Get the current point.
* [SetFreePoint](#setfreepoint) Set the current free point.
* [GetFreePoint](#getfreepoint) Get the current free point.
* [GetAvailablePoint](#getavalablepoint) Get the current point.
* [isNumber](#isnumber) Indicates whether the value is number.
## Details
#### currentPoint
> Current point.<br/>
> The current point.<br/>
| meta | description |
| :--- | :---------- |
@ -29,7 +29,7 @@ sidebar_position: 2
| Defined in | [p4f-game-core/src/model/balance-model.js:8](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/model/balance-model.js#L9)|
#### freePoint
> Current free point.<br/>
> The current free point.<br/>
| meta | description |
| :--- | :---------- |
@ -37,35 +37,35 @@ sidebar_position: 2
| Defined in | [p4f-game-core/src/model/balance-model.js:9](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/model/balance-model.js#L9)|
#### SetCurrentPoint
> Set current point.<br/>
> Set the current point.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-game-core/src/model/balance-model.js:14](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/model/balance-model.js#L14)|
#### GetCurrentPoint
> Get current point.<br/>
> Get the current point.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-game-core/src/model/balance-model.js:21](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/model/balance-model.js#L21)|
#### SetFreePoint
> Set Current free point.<br/>
> Set the current free point.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-game-core/src/model/balance-model.js:27](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/model/balance-model.js#L27)|
#### GetFreePoint
> Get current free point.<br/>
> Get the current free point.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-game-core/src/model/balance-model.js:34](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/model/balance-model.js#L34)|
#### GetAvailablePoint
> Get current point.<br/>
> Get the current point.<br/>
| meta | description |
| :--- | :---------- |

View File

@ -7,12 +7,12 @@ sidebar_position: 3
## Index
### Methods
* [BalanceChangeRate](#balancechangerate)
* [BalanceChangeRate](#balancechangerate) Called when get new balance data.
## Details
#### BalanceChangeRate
> ...
> Called when get new balance data.
| meta | description |
| :--- | :---------- |

View File

@ -1,5 +1,5 @@
{
"position": 6,
"position": 36,
"label": "End Round",
"collapsible": true,
"collapsed": true,

View File

@ -0,0 +1,18 @@
{
"position": 1,
"label": "Initialize",
"collapsible": true,
"collapsed": true,
"link": {
"type": "generated-index",
"title": "Initialize",
"description": "This section will guide you through the process of setting up a new project, including creating a new repository and configuring your development environment.",
"keywords": [
"controller",
"project",
"repository",
"model",
"initialize"
]
}
}

View File

@ -1,5 +1,5 @@
{
"position": 7,
"position": 8,
"label": "Present Feature Trigger",
"collapsible": true,
"collapsed": true,

View File

@ -1,5 +1,5 @@
{
"position": 29,
"position": 9,
"label": "Present Feature Win",
"collapsible": true,
"collapsed": true,

View File

@ -0,0 +1,18 @@
{
"position": 7,
"label": "Present Win",
"collapsible": true,
"collapsed": true,
"link": {
"type": "generated-index",
"title": "Present Win",
"description": "This section will guide you through the process of setting up a new project, including creating a new repository and configuring your development environment.",
"keywords": [
"controller",
"project",
"repository",
"model",
"presentwin"
]
}
}

View File

@ -0,0 +1,131 @@
---
sidebar_position: 1
---
# Present Win Controller
## Index
### Methods
* [_registerEvent](#_registerevent) Register events.
* [_start](#_start) Initialize some logic which need to be called the game enters the Present Win State.
* [reset](#reset) Reset the current win presentation data.
* [getAllWinsData](#onreplayhistoryclient) Get the all wins data.
* [presentWin](#onresume) Start the current win presentation.
* [transitionToNextState](#isresumeend) Check the condition and move to the next state.
* [presentPoint](#ondeposit) Start the current win point presentation.
* [getSequencePresentWin](#onconnected) Process the current win data and return a sequence of present wins.
* [startSequencePresentWin](#onstartgame) Start the sequence of present wins.
* [calculateDurationPresentAllWins](#oncollectdatareceived) Calculate the duration of present wins.
* [onPresentSpecialWinTriggered](#onbalancedatareceived) Start the special win.
* [onPresentSpecialWinCompleted](#onbalancechangerateclicked) Stop the special win.
* [onPresentWinPointCompleted](#updatebalance) Stop the current win point presentation.
* [onPresentWinTurboCompleted](#notifyblance) Notify the client balance.
* [allowLoopPresentation](#placebet) Indicates whether the sequence of present wins.
## Details
#### _registerevent
> Register events.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/present-win-controller.js:32](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/present-win-controller.js#L32)|
#### _start
> Initialize some logic which need to be called the game enters the Bet State.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/present-win-controller.js:41](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/present-win-controller.js#L41)|
#### reset
> Reset the current win presentation data.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/present-win-controller.js:53](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/present-win-controller.js#L53)|
#### getAllWinsData
> Get the all wins data.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/present-win-controller.js:64](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/present-win-controller.js#L64)|
#### presentWin
> Start the current win presentation.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/present-win-controller.js:82](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/present-win-controller.js#L82)|
#### transitionToNextState
> Check the condition and move to the next state.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/present-win-controller.js:91](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/present-win-controller.js#L91)|
#### presentPoint
> Start the current win point presentation.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/present-win-controller.js:125](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/present-win-controller.js#L125)|
#### getSequencePresentWin
> Process the current win data and return a sequence of present wins.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/present-win-controller.js:137](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/present-win-controller.js#L137)|
#### startSequencePresentWin
> Start the sequence of present wins.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/present-win-controller.js:168](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/present-win-controller.js#L168)|
#### calculateDurationPresentAllWins
> Calculate the duration of present wins.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/present-win-controller.js:216](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/present-win-controller.js#L216)|
#### onPresentSpecialWinTriggered
> Start the special win.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/present-win-controller.js:228](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/present-win-controller.js#L228)|
#### onPresentSpecialWinTriggered
> Stop the special win.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/present-win-controller.js:237](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/present-win-controller.js#L237)|
#### onPresentWinPointCompleted
> Stop the current win point presentation.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/present-win-controller.js:245](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/present-win-controller.js#L245)|
#### onPresentWinTurboCompleted
> Stop the current win presentation if turbo mode is active.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/present-win-controller.js:254](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/present-win-controller.js#L254)|
#### onPresentWinPointCompleted
> Indicates whether the sequence of present wins.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/present-win-controller.js:264](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/present-win-controller.js#L264)|

View File

@ -0,0 +1,141 @@
---
sidebar_position: 2
---
# Present Win Model
## Index
### Properties
* [winLinesData](#winlinesdata) `WinlineData` The current win lines data.
* [winScattersData](#winscattersdata) `WinlineData` The current scatter win data.
* [winPoint](#winpoint) `Number` The current win point.
* [durationPresentAllWins](#durationpresentallwins) `Number` The duration of all wins.
* [durationPresentWinLines](#durationpresentwinlines) `Number` The duration of win lines.
* [durationPresentWinScatters](#durationpresentwinscatters) `Number` The duration of scatter win.
### Methods
* [Reset](#reset) Reset the present win data.
* [SetWinLinesData](#setwinlinesdata) Set the current win lines data.
* [GetWinLinesData](#getwinlinesdata) Get the current win lines data.
* [SetWinScattersData](#setwinscattersdata) Set the current scatter win data.
* [GetWinScattersData](#getwinscattersdata) Get the current scatter win data.
* [SetWinPoint](#setwinpoint) Set the current win point.
* [GetWinPoint](#getwinpoint) Get the current win point.
* [SetDurationPresentAllWins](#setdurationpresentallwins) Set the duration of all wins.
* [GetDurationPresentAllWins](#getdurationpresentallwins) Get the duration of all wins.
## Details
#### winLinesData
> The current win lines data.<br/>
| meta | description |
| :--- | :---------- |
| Type | [WinlineData](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/slotty-data/response-data/win-line-data.js) |
| Defined in | [p4f-slotty-core/src/model/present-win-model.js:11](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/model/present-win-model.js#L11)|
#### winScattersData
> The current scatter win data.<br/>
| meta | description |
| :--- | :---------- |
| Type | [WinlineData](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/slotty-data/response-data/win-line-data.js) |
| Defined in | [p4f-slotty-core/src/model/present-win-model.js:12](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/model/present-win-model.js#L12)|
#### winPoint
> The current win point.<br/>
| meta | description |
| :--- | :---------- |
| Type | [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) |
| Defined in | [p4f-slotty-core/src/model/present-win-model.js:13](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/model/present-win-model.js#L13)|
#### durationPresentAllWins
> The duration of all wins.<br/>
| meta | description |
| :--- | :---------- |
| Type | [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) |
| Defined in | [p4f-slotty-core/src/model/present-win-model.js:14](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/model/present-win-model.js#L14)|
#### durationPresentWinLines
> The duration of win lines.<br/>
| meta | description |
| :--- | :---------- |
| Type | [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) |
| Defined in | [p4f-slotty-core/src/model/present-win-model.js:15](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/model/present-win-model.js#L15)|
#### durationPresentWinScatters
> The duration of scatter win.<br/>
| meta | description |
| :--- | :---------- |
| Type | [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) |
| Defined in | [p4f-slotty-core/src/model/present-win-model.js:16](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/model/present-win-model.js#L16)|
#### Reset
> Reset the present win data.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/model/present-win-model.js:21](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/model/present-win-model.js#L21)|
#### SetWinLinesData
> Set the current win lines data.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/model/present-win-model.js:32](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/model/present-win-model.js#L32)|
#### GetWinLinesData
> Get the current win lines data.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/model/present-win-model.js:38](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/model/present-win-model.js#38)|
#### SetWinScattersData
> Set the current scatter win data.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/model/present-win-model.js:42](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/model/present-win-model.js#L42)|
#### GetWinScattersData
> Get the current scatter win data.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/model/present-win-model.js:48](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/model/present-win-model.js#48)|
#### SetWinPoint
> Set the current win point.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/model/present-win-model.js:52](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/model/present-win-model.js#L52)|
#### GetWinPoint
> Get the current win point.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/model/present-win-model.js:58](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/model/present-win-model.js#58)|
#### SetDurationPresentAllWins
> Set the duration of all wins.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/model/present-win-model.js:52](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/model/present-win-model.js#L52)|
#### GetDurationPresentAllWins
> Get the duration of all wins.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/model/present-win-model.js:58](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/model/present-win-model.js#58)|

View File

@ -0,0 +1,87 @@
---
sidebar_position: 3
---
# Present Win View
## Index
### Properties
* [listTimer](#listtimer) `Timer` List of timer actions that have a finite duration.
### Methods
* [StartPresentWin](#startpresentwin) Called when the win presentation starts.
* [StopPresentWin](#stoptpresentwin) Called when the win presentation has completed.
* [GetDurationFromHitItems](#getdurationfromhititems) Get duration of the win item's animation.
* [PresentWinTurbo](#presentwinturbo) Called when the win presentation is running in turbo mode.
* [PresentAllWins](#presentallwins) Called when the win presentation displays all win items.
* [PresentWinLines](#presentwinlines) Called when the win presentation displays win lines.
* [PresentWinScatters](#presentwinscatters) Called when the win presentation displays the scatter win.
* [clearTimer](#cleartimer) Clear the list of timer actions.
## Details
#### listTimer
> List of timer actions that have a finite duration.<br/>
| meta | description |
| :--- | :---------- |
| Type | [Timer](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/helper/timer.js#L4) |
| Defined in | [p4f-slotty-core/src/view/present-win-view.js:12](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/view/present-win-view.js#L12)|
#### StartPresentWin
> Called when the win presentation starts.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/view/present-win-view.js:17](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/view/present-win-view.js#L17)|
#### StopPresentWin
> Called when the win presentation has completed.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/view/present-win-view.js:23](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/view/present-win-view.js#L23)|
#### GetDurationFromHitItems
> Get duration of the win item's animation.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/view/present-win-view.js:29](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/view/present-win-view.js#L29)|
#### PresentWinTurbo
> Called when the win presentation is running in turbo mode.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/view/present-win-view.js:33](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/view/present-win-view.js#L33)|
#### PresentAllWins
> Called when the win presentation is running in turbo mode.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/view/present-win-view.js:47](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/view/present-win-view.js#L47)|
#### PresentWinLines
> Called when the win presentation displays win lines.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/view/present-win-view.js:61](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/view/present-win-view.js#L61)|
#### PresentWinScatters
> Called when the win presentation displays the scatter win.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/view/present-win-view.js:89](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/view/present-win-view.js#L89)|
#### clearTimer
> Clear the list of timer actions.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/view/present-win-view.js:117](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/view/present-win-view.js#L117)|