Compare commits

...

6 Commits

17 changed files with 337 additions and 16 deletions

View File

@ -6,6 +6,11 @@ sidebar_position: 0
# Slot Game API
## Slot Game Machine
* [Initialize Controller](slot-machine/initialize-controller)
* [Initialize](slot-machine/initialize-controller)
* [Balance](category/balance)
* [Bet](category/bet)
* [Spin](category/spin)
* [After Spin](category/after-spin)
* [Present Feature Trigger](category/present-feature-trigger)
* [Auto Spin](category/after-spin)
* [Take Or Gamble](category/take-or-gamble)

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

View File

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

View File

@ -1,14 +1,18 @@
---
---
sidebar_position: 2
---
# Auto Spin Model
# EndRoundModel
## 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:
* Initializes a new instance of EndRoundModel.
* Calls the base model constructor.
* [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)
## Description
- Initializes a new instance of `EndRoundModel`.
- 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
---
# Auto Spin view
# EndRoundView
## 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:
* Initializes a new instance of EndRoundView.
* Calls the base View constructor.
* [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)
## Description
- Constructs a new EndRoundView instance.
- 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": 7,
"label": "Present Feature Trigger",
"collapsible": true,
"collapsed": true,
"link": {
"type": "generated-index",
"title": "Present Feature Trigger",
"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",
"trigger"
]
}
}

View File

@ -0,0 +1,44 @@
---
sidebar_position: 2
---
# Present Feature Trigger Controller
## Index
### Methods
* [_start](#_start) Initialize some logic which need to be called the game enters the Bet State.
* [_registerEvent](#_registerevent) Register events.
* [onPresentFeatureTriggerCompleted](#onpresentfeaturetriggercompleted) Start feature game.
* [startFeatureGame](#startfeaturegame) Check the feature game condition and start base on it.
## Details
#### _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-feature-trigger-controller.js:16](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/present-feature-trigger-controller.js#L16)|
#### _registerevent
> Register events.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/present-feature-trigger-controller.js:23](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/present-feature-trigger-controller.js#L23)|
#### onPresentFeatureTriggerCompleted
> Start feature game.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/present-feature-trigger-controller.js:29](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/present-feature-trigger-controller.js#L29)|
#### startFeatureGame
> Check the feature game condition and start base on it.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/controller/present-feature-trigger-controller.js:37](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/present-feature-trigger-controller.js#L37)|

View File

@ -0,0 +1,46 @@
---
sidebar_position: 2
---
# Present Feature Trigger Model
## Index
### Properties
* [featureData](#featuredata) `WinlineData` The current feature trigger data.
### Methods
* [Reset](#reset) Reset the feature trigger data.
* [SetFeatureTriggerData](#setfeaturetriggerdata) Set the feature trigger data.
* [GetFeatureTriggerData](#getfeaturetriggerdata) Get the feature trigger data.
## Details
#### featureData
> Current point.<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-feature-trigger-model.js:10](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/model/present-feature-trigger-model.js#L10)|
#### Reset
> Reset the feature trigger data.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/model/present-feature-trigger-model.js:15](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/model/present-feature-trigger-model.js#L15)|
#### SetFeatureTriggerData
> Set the feature trigger data.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/model/present-feature-trigger-model.js:21](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/model/present-feature-trigger-model.js#L21)|
#### GetFeatureTriggerData
> Get the feature trigger data.<br/>
| meta | description |
| :--- | :---------- |
| Defined in | [p4f-slotty-core/src/model/present-feature-trigger-model.js:27](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/model/present-feature-trigger-model.js#L27)|

View File

@ -0,0 +1,5 @@
---
sidebar_position: 3
---
# Present Feature Trigger View

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)