Compare commits

...

4 Commits

Author SHA1 Message Date
2af308f258 add doc present feature win 2025-07-15 17:45:47 +07:00
6ad5c9d960 add after spin controller 2025-07-15 17:45:47 +07:00
bfd25398c1 update name script 2025-07-15 14:03:02 +07:00
833ddaddcd add take and gamble doc 2025-07-15 13:33:59 +07:00
17 changed files with 505 additions and 16 deletions

View File

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

View File

@ -0,0 +1,18 @@
{
"position": 5,
"label": "After Spin",
"collapsible": true,
"collapsed": true,
"link": {
"type": "generated-index",
"title": "After Spin",
"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",
"afterspin"
]
}
}

View File

@ -0,0 +1,19 @@
---
sidebar_position: 1
---
# After Spin Controller
## Index
### Methods
* [transitionToNextState](#transitiontonextstate) Check the condition and move to the next state.
## Details
#### transitionToNextState
> Check the condition and move to the next state.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/after-spin-controller.js:21](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/after-spin-controller.js#L21)|

View File

@ -0,0 +1,5 @@
---
sidebar_position: 2
---
# After Spin Model

View File

@ -0,0 +1,5 @@
---
sidebar_position: 3
---
# After Spin View

View File

@ -1,5 +1,5 @@
--- ---
sidebar_position: 2 sidebar_position: 1
--- ---
# Balance Controller # Balance Controller

View File

@ -1,5 +1,5 @@
--- ---
sidebar_position: 2 sidebar_position: 3
--- ---
# Balance View # Balance View

View File

@ -1,14 +1,18 @@
--- ---
---
sidebar_position: 2 sidebar_position: 2
--- ---
# Auto Spin Model # EndRoundModel
## Overview ## Overview
* EndRoundModel is a model class for the spin feature in the slot game. It extends the base model class and is intended to handle the visual representation and UI logic for spins. `EndRoundModel` is a model class for managing the end-of-round logic in the slot machine game. It extends the base model class and is responsible for handling the visual representation and UI logic related to the end of a spin.
## Description: ## Description
* Initializes a new instance of EndRoundModel.
* Calls the base model constructor. - Initializes a new instance of `EndRoundModel`.
* [p4f-game-core/src/view/end-round-model.js:#L5](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/end-round-model.js#L5) - Calls the base model constructor.
- Handles end-of-round events and updates the UI accordingly.
[Source code reference](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/end-round-model.js#L5)

View File

@ -2,13 +2,14 @@
sidebar_position: 3 sidebar_position: 3
--- ---
# Auto Spin view # EndRoundView
## Overview ## Overview
* EndRoundView is a view class for the spin feature in the slot game. It extends the base View class and is intended to handle the visual representation and UI logic for spins. EndRoundView is a UI component for managing the end-of-round visuals in the slot machine game. It extends the base View class, providing logic and presentation for the spin completion state.
## Description: ## Description
* Initializes a new instance of EndRoundView.
* Calls the base View constructor. - Constructs a new EndRoundView instance.
* [p4f-game-core/src/view/end-round-view.js:#L5](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/view/end-round-view.js#L5) - Invokes the base View constructor for initialization.
- [Source code reference](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/view/end-round-view.js#L5)

View File

@ -0,0 +1,18 @@
{
"position": 29,
"label": "Present Feature Win",
"collapsible": true,
"collapsed": true,
"link": {
"type": "generated-index",
"title": "Present Feature 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",
"present-feature-win"
]
}
}

View File

@ -0,0 +1,60 @@
---
sidebar_position: 1
---
# Present Feature Win Controller
## Index
### Methods
- [_start](#_start) Initializes feature win state and notifies the game controller.
- [_complete](#_complete) Resets the model state after feature is done.
- [getFeatureWinData](#getfeaturewindata) Retrieves a structured object describing current feature win state.
- [onViewPresentFeatureWinCompleted](#onviewpresentfeaturewincompleted) Handles the event when the view finishes win presentation. Triggers bonus, freespin, or round end logic accordingly.
---
## Details
### Methods
#### _start
Initializes feature win state and notifies the game controller.
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/present-feature-win-controller.js#L17](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/present-feature-win-controller.js#L17) |
---
#### _complete
Resets the model state after feature is done.
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/present-feature-win-controller.js#L28](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/present-feature-win-controller.js#L28) |
---
#### getFeatureWinData
Retrieves a structured object describing current feature win state
| meta | description |
| :--- | :---------- |
| Returns | Object |
| Defined in | [p4f-slotty-core/src/controller/present-feature-win-controller.js#L34](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/present-feature-win-controller.js#L34) |
---
#### onViewPresentFeatureWinCompleted
Handles the event when the view finishes win presentation. Triggers bonus, freespin, or round end logic accordingly.
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/present-feature-win-controller.js#L47](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/present-feature-win-controller.js#L47) |
---

View File

@ -0,0 +1,181 @@
---
sidebar_position: 2
---
# Present Feature Win Model
## Index
### Properties
- [featureHitRule](#featurehitrule) `String` Rule that determines how the feature is triggered.
- [featurePlayedCount](#featureplayedcount) `Number` Number of times the feature has been played.
- [gameWinPoint](#gamewinpoint) `Number` Points won in the base game.
- [featureWinPoint](#featurewinpoint) `Number` Points won in the feature game.
### Methods
- [Reset](#reset) Resets all model properties to default values.
- [SetFeaturePlayedCount](#setfeatureplayedcount) Sets the number of times the feature has been played.
- [GetFeaturePlayedCount](#getfeatureplayedcount) Gets the number of times the feature has been played.
- [SetFeatureHitRule](#setfeaturehitrule) Sets the rule used to trigger the feature.
- [GetFeatureHitRule](#getfeaturehitrule) Gets the feature hit rule.
- [SetGameWinPoint](#setgamewinpoint) Sets the number of points won in the base game.
- [GetGameWinPoint](#getgamewinpoint) Gets the number of points won in the base game.
- [SetFeatureWinPoint](#setfeaturewinpoint) Sets the number of points won in the feature game.
- [GetFeatureWinPoint](#getfeaturewinpoint) Gets the number of points won in the feature game.
- [GetTotalWinPoint](#gettotalwinpoint) Gets the total number of points won (game + feature).
---
## Details
### Properties
#### featureHitRule
> Rule that determines how the feature is triggered.
| meta | description |
| :--- | :---------- |
| Type | String |
| Defined in | [p4f-slotty-core/src/model/present-feature-win-model.js#L7](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/present-feature-win-model.js#L7) |
---
#### featurePlayedCount
> Number of times the feature has been played.
| meta | description |
| :--- | :---------- |
| Type | Number |
| Defined in | [p4f-slotty-core/src/model/present-feature-win-model.js#L8](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/present-feature-win-model.js#L8) |
---
#### gameWinPoint
> Points won in the base game.
| meta | description |
| :--- | :---------- |
| Type | Number |
| Defined in | [p4f-slotty-core/src/model/present-feature-win-model.js#L9](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/present-feature-win-model.js#L9) |
---
#### featureWinPoint
> Points won in the feature game.
| meta | description |
| :--- | :---------- |
| Type | Number |
| Defined in | [p4f-slotty-core/src/model/present-feature-win-model.js#L10](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/present-feature-win-model.js#L10) |
---
### Methods
#### Reset
Resets all model properties to default values.
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/model/present-feature-win-model.js#L16](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/present-feature-win-model.js#L16) |
---
#### SetFeaturePlayedCount
Sets the number of times the feature has been played.
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/model/present-feature-win-model.js#L25](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/present-feature-win-model.js#L25) |
---
#### GetFeaturePlayedCount
Gets the number of times the feature has been played.
| meta | description |
| :--- | :---------- |
| Returns | Number |
| Defined in | [p4f-slotty-core/src/model/present-feature-win-model.js#L31](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/present-feature-win-model.js#L31) |
---
#### SetFeatureHitRule
Sets the rule used to trigger the feature.
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/model/present-feature-win-model.js#L35](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/present-feature-win-model.js#L35) |
---
#### GetFeatureHitRule
Gets the feature hit rule.
| meta | description |
| :--- | :---------- |
| Returns | String |
| Defined in | [p4f-slotty-core/src/model/present-feature-win-model.js#41](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/present-feature-win-model.js#41) |
---
#### SetGameWinPoint
Sets the number of points won in the base game.
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/model/present-feature-win-model.js#L45](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/present-feature-win-model.js#L45) |
---
#### GetGameWinPoint
Gets the number of points won in the base game.
| meta | description |
| :--- | :---------- |
| Returns | Number |
| Defined in | [p4f-slotty-core/src/model/present-feature-win-model.js#L51](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/present-feature-win-model.js#L51) |
---
#### SetFeatureWinPoint
Sets the number of points won in the feature game.
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/model/present-feature-win-model.js#L55](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/present-feature-win-model.js#L55) |
---
#### GetFeatureWinPoint
Gets the number of points won in the feature game.
| meta | description |
| :--- | :---------- |
| Returns | Number |
| Defined in | [p4f-slotty-core/src/model/present-feature-win-model.js#L61](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/present-feature-win-model.js#L61) |
---
#### GetTotalWinPoint
Gets the total number of points won (game + feature).
| meta | description |
| :--- | :---------- |
| Returns | Number |
| Defined in | [p4f-slotty-core/src/model/present-feature-win-model.js#L65](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/present-feature-win-model.js#L65) |

View File

@ -0,0 +1,24 @@
---
sidebar_position: 3
---
# Present Feature Win View
## Index
### Methods
- [PresentComplete](#presentcomplete) Triggers the `PresentFeatureWinCompleted` event.
---
## Details
### Methods
#### PresentComplete
Triggers the `PresentFeatureWinCompleted` event which signals that the feature win presentation has completed.
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/view/present-feature-win-view.js#L13](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/view/present-feature-win-view.js#L13) |

View File

@ -0,0 +1,18 @@
{
"position": 30,
"label": "Take and Gamble",
"collapsible": true,
"collapsed": true,
"link": {
"type": "generated-index",
"title": "Take and Gamble",
"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",
"take-and-gamble"
]
}
}

View File

@ -0,0 +1,101 @@
---
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) |

View File

@ -0,0 +1,16 @@
---
sidebar_position: 2
---
# Take Or Gamble Model
## Overview
`Take Or Gamble Model` is a model class for the "Take or Gamble" feature in the slot game. It extends the base model class and manages the logic and state for handling win events, including the decision to take winnings or gamble for more.
## Description
- Initializes a new instance of `Take Or Gamble Model`.
- Calls the base model constructor.
- Handles UI logic and state for the "Take or Gamble" feature.
- [Source code reference](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/take-or-gamble-model.js#L5)

View File

@ -0,0 +1,16 @@
---
sidebar_position: 3
---
# Take Or Gamble View
## Overview
`Take Or Gamble View` is a UI component for the slot machine's spin feature. It extends the base `View` class and manages the display and user interactions related to taking winnings or gambling them.
## Description
- Constructs a new `Take Or Gamble View` instance.
- Invokes the base `View` constructor.
- Source: [`take-or-gamble-view.js:5`](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/view/take-or-gamble-view.js#L5)