add doc spin api
This commit is contained in:
parent
558802b28a
commit
2d82b26863
18
api-doc/controllers/spin/_category_.json
Normal file
18
api-doc/controllers/spin/_category_.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"position": 3,
|
||||
"label": "Spin",
|
||||
"collapsible": true,
|
||||
"collapsed": true,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"title": "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",
|
||||
"spin"
|
||||
]
|
||||
}
|
||||
}
|
134
api-doc/controllers/spin/spin-controller.md
Normal file
134
api-doc/controllers/spin/spin-controller.md
Normal file
@ -0,0 +1,134 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Spin Controller
|
||||
|
||||
## Index
|
||||
|
||||
### Properties
|
||||
|
||||
* [savedBetPoint](#savedbetpoint) `Number` Current played bet.
|
||||
* [savedTotalBetPoint](#savedtotalbetpoint) `Number` Current total played bet.
|
||||
* [isPaused](#ispaused) `Boolean` Indicates if the game is currently paused, including when paused by lobby force.
|
||||
* [waiter](#waiter) `object ` Waits until not paused.
|
||||
|
||||
### Methods
|
||||
|
||||
* [_start](#_start) Starts a spin round. Prepares spin data, handles game round confirmation, and waits until the game is not paused before sending a spin request.
|
||||
* [_complete](#_complete) Completes the spin round and stops any waiting processes.
|
||||
* [onBetDataChanged](#onbetdatachanged) Updates internal bet tracking based on input data.
|
||||
* [onNextScrollDataReceived](#onnextscrolldatareceived) Updates the model with new scroll data received from the network.
|
||||
* [onStopSpinClicked](#onstopspinclicked) Notifies listeners when the stop spin button is clicked.
|
||||
|
||||
>
|
||||
|
||||
## Details
|
||||
|
||||
### Properties
|
||||
|
||||
#### savedbetpoint
|
||||
|
||||
> <p style={{ color: 'gray', fontSize: '1.0em' }}> Current played bet.</p>
|
||||
|
||||
| meta | description |
|
||||
| :--- | :---------- |
|
||||
| Type | [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) |
|
||||
| Defined in | [p4f-slotty-core/src/controller/spin-controller.js#L14](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/spin-controller.js#L14)|
|
||||
|
||||
#### savedTotalBetPoint
|
||||
|
||||
> <p style={{ color: 'gray', fontSize: '1.0em' }}> Current total played bet.</p>
|
||||
|
||||
| meta | description |
|
||||
| :--- | :---------- |
|
||||
| Type | [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) |
|
||||
| Defined in | [p4f-slotty-core/src/controller/spin-controller.js#L15](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/spin-controller.js#L15)|
|
||||
|
||||
#### isPaused
|
||||
|
||||
> <p style={{ color: 'gray', fontSize: '1.0em' }}> Indicates if the game is currently paused, including when paused by lobby force.</p>
|
||||
|
||||
| meta | description |
|
||||
| :--- | :---------- |
|
||||
| Type | [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) |
|
||||
| Defined in | [p4f-slotty-core/src/controller/spin-controller.js#L16](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/spin-controller.js#L16)|
|
||||
|
||||
#### waiter
|
||||
|
||||
> <p style={{ color: 'gray', fontSize: '1.0em' }}> Waits until not paused.</p>
|
||||
|
||||
| meta | description |
|
||||
| :--- | :---------- |
|
||||
| Type | [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) \| null |
|
||||
| Defined in | [p4f-slotty-core/src/controller/spin-controller.js#L17](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/spin-controller.js#L17)|
|
||||
|
||||
### Methods
|
||||
|
||||
#### _start
|
||||
|
||||
Starts a spin round. Prepares spin data, handles game round confirmation, and waits until the game is not paused before sending a spin request.
|
||||
|
||||
| meta | description |
|
||||
| :--- | :---------- |
|
||||
| Defined in | [p4f-slotty-core/src/controller/spin-controller.js#L32](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/spin-controller.js#L32)|
|
||||
|
||||
<p style={{ color: 'gray', fontSize: '1.0em' }}>
|
||||
|
||||
**Parameters**
|
||||
* `data` [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
||||
|
||||
* `betPoint` [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
||||
* `totalBetPoint` [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
||||
* `isFreeSpin` [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)
|
||||
* `freeroundsID` [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
|
||||
</p>
|
||||
|
||||
#### _complete
|
||||
|
||||
Completes the spin round and stops any waiting processes.
|
||||
|
||||
| meta | description |
|
||||
| :--- | :---------- |
|
||||
| Defined in | [p4f-slotty-core/src/controller/spin-controller.js#L68](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/spin-controller.js#L68)|
|
||||
|
||||
|
||||
#### onBetDataChanged
|
||||
|
||||
> Updates internal bet tracking based on input data.
|
||||
|
||||
| meta | description |
|
||||
| :--- | :---------- |
|
||||
| Defined in | [p4f-slotty-core/src/controller/spin-controller.js#L77](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/spin-controller.js#L77)|
|
||||
|
||||
<p style={{ color: 'gray', fontSize: '1.0em' }}>
|
||||
|
||||
**Parameters**
|
||||
* `data` [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
||||
|
||||
* `betPoint` [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number).
|
||||
* `totalBetPoint` [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number).
|
||||
</p>
|
||||
|
||||
#### onNextScrollDataReceived
|
||||
|
||||
Updates the model with the new scroll data received from the network.
|
||||
|
||||
| meta | description |
|
||||
| :--- | :---------- |
|
||||
| Defined in | [p4f-slotty-core/src/controller/spin-controller.js#L83](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/spin-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)
|
||||
</p>
|
||||
|
||||
#### onStopSpinClicked
|
||||
|
||||
Notifies listeners when the stop spin button is clicked.
|
||||
|
||||
| meta | description |
|
||||
| :--- | :---------- |
|
||||
| Defined in | [p4f-slotty-core/src/controller/spin-controller.js#L89](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/controller/spin-controller.js#L89)|
|
||||
|
114
api-doc/controllers/spin/spin-model.md
Normal file
114
api-doc/controllers/spin/spin-model.md
Normal file
@ -0,0 +1,114 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
# Spin model
|
||||
|
||||
## Index
|
||||
|
||||
### Properties
|
||||
|
||||
* [nextScrollData](#nextscrolldata) `Object` Stores the next scroll data
|
||||
* [betPoint](#betpoint) `Number` Stores the current bet point.
|
||||
* [totalBetPoint](#totalbetpoint) `Number` Stores the total bet point.
|
||||
|
||||
### Methods
|
||||
|
||||
* [SetBetPoint](#setbetpoint) Sets the bet point value.
|
||||
* [GetBetPoint](#getbetpoint) Gets the current bet point value.
|
||||
* [SetTotalBetPoint](#settotalbetpoint) Sets the total bet point value.
|
||||
* [GetTotalBetPoint](#gettotalbetpoint) Gets the current total bet point value.
|
||||
* [SetNextScrollData](#setnextscrolldata) Sets the next scroll data.
|
||||
|
||||
## Details
|
||||
|
||||
### Properties
|
||||
|
||||
#### nextScrollData
|
||||
|
||||
> <p style={{ color: 'gray', fontSize: '1.0em' }}> Stores the current bet point.</p>
|
||||
|
||||
| meta | description |
|
||||
| :--- | :---------- |
|
||||
| Type | [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) \| null |
|
||||
| Defined in | [p4f-slotty-core/src/model/spin-model.js.js#L9](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/spin-model.js#L9)|
|
||||
|
||||
#### betPoint
|
||||
|
||||
> <p style={{ color: 'gray', fontSize: '1.0em' }}> Stores the next scroll data.</p>
|
||||
|
||||
| meta | description |
|
||||
| :--- | :---------- |
|
||||
| Type | [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) |
|
||||
| Defined in | [p4f-slotty-core/src/model/spin-model.js.js#L10](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/spin-model.js#L10)|
|
||||
|
||||
#### totalBetPoint
|
||||
|
||||
> <p style={{ color: 'gray', fontSize: '1.0em' }}> Stores the next scroll data.</p>
|
||||
|
||||
| meta | description |
|
||||
| :--- | :---------- |
|
||||
| Type | [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)|
|
||||
| Defined in | [p4f-slotty-core/src/model/spin-model.js.js#L10](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/spin-model.js#L10)|
|
||||
|
||||
### Meethods
|
||||
|
||||
#### SetBetPoint
|
||||
|
||||
Sets the bet point value.
|
||||
|
||||
| meta | description |
|
||||
| :--- | :---------- |
|
||||
| Defined in | [p4f-slotty-core/src/model/spin-model.js.js#L16](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/spin-model.js#L16)|
|
||||
|
||||
<p style={{ color: 'gray', fontSize: '1.0em' }}>
|
||||
|
||||
**Parameters**
|
||||
* `betPoint` [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
||||
</p>
|
||||
|
||||
#### GetBetPoint
|
||||
|
||||
Gets the current bet point value.
|
||||
|
||||
| meta | description |
|
||||
| :--- | :---------- |
|
||||
| Returns | [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)|
|
||||
| Defined in | [p4f-slotty-core/src/model/spin-model.js.js#L22](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/spin-model.js#L22)|
|
||||
|
||||
#### SetTotalBetPoint
|
||||
|
||||
Stores the total bet point.
|
||||
|
||||
| meta | description |
|
||||
| :--- | :---------- |
|
||||
| Defined in | [p4f-slotty-core/src/model/spin-model.js.js#L28](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/spin-model.js#L28)|
|
||||
|
||||
<p style={{ color: 'gray', fontSize: '1.0em' }}>
|
||||
|
||||
**Parameters**
|
||||
* `totalBetPoint` [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
||||
</p>
|
||||
|
||||
#### GetTotalBetPoint
|
||||
|
||||
Gets the current total bet point value.
|
||||
|
||||
| meta | description |
|
||||
| :--- | :---------- |
|
||||
| Returns | [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)|
|
||||
| Defined in | [p4f-slotty-core/src/model/spin-model.js.js#L34](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/spin-model.js#L34)|
|
||||
|
||||
#### SetNextScrollData
|
||||
|
||||
Sets the next scroll data.
|
||||
|
||||
| meta | description |
|
||||
| :--- | :---------- |
|
||||
| Defined in | [p4f-slotty-core/src/model/spin-model.js.js#L40](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/spin-model.js#L40)|
|
||||
|
||||
<p style={{ color: 'gray', fontSize: '1.0em' }}>
|
||||
|
||||
**Parameters**
|
||||
* `nextScrollData` [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
||||
</p>
|
14
api-doc/controllers/spin/spin-view.md
Normal file
14
api-doc/controllers/spin/spin-view.md
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
sidebar_position: 3
|
||||
---
|
||||
|
||||
# Spin view
|
||||
|
||||
## Overview
|
||||
|
||||
* SpinView 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.
|
||||
|
||||
## Description:
|
||||
* Initializes a new instance of SpinView.
|
||||
* Calls the base View constructor.
|
||||
|
Loading…
x
Reference in New Issue
Block a user