From 527d6629b3c4e85b5ab1ee03ab41f1b9a4203d42 Mon Sep 17 00:00:00 2001 From: dungdq Date: Tue, 15 Jul 2025 13:33:59 +0700 Subject: [PATCH] add take and gamble doc --- .../slot-machine/end-round/end-round-model.md | 16 +-- .../slot-machine/end-round/end-round-view.md | 13 +-- .../take-and-gamble/_category_.json | 18 ++++ .../take-and-gamble-controller.md | 101 ++++++++++++++++++ .../take-and-gamble/take-and-gamble-model.md | 16 +++ .../take-and-gamble/take-and-gamble-view.md | 16 +++ 6 files changed, 168 insertions(+), 12 deletions(-) create mode 100644 api-doc/slot-machine/take-and-gamble/_category_.json create mode 100644 api-doc/slot-machine/take-and-gamble/take-and-gamble-controller.md create mode 100644 api-doc/slot-machine/take-and-gamble/take-and-gamble-model.md create mode 100644 api-doc/slot-machine/take-and-gamble/take-and-gamble-view.md diff --git a/api-doc/slot-machine/end-round/end-round-model.md b/api-doc/slot-machine/end-round/end-round-model.md index dd126db..f6704e5 100644 --- a/api-doc/slot-machine/end-round/end-round-model.md +++ b/api-doc/slot-machine/end-round/end-round-model.md @@ -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) \ No newline at end of file +## 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) \ No newline at end of file diff --git a/api-doc/slot-machine/end-round/end-round-view.md b/api-doc/slot-machine/end-round/end-round-view.md index bc2020a..94eedfd 100644 --- a/api-doc/slot-machine/end-round/end-round-view.md +++ b/api-doc/slot-machine/end-round/end-round-view.md @@ -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) diff --git a/api-doc/slot-machine/take-and-gamble/_category_.json b/api-doc/slot-machine/take-and-gamble/_category_.json new file mode 100644 index 0000000..1af0d17 --- /dev/null +++ b/api-doc/slot-machine/take-and-gamble/_category_.json @@ -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" + ] + } +} \ No newline at end of file diff --git a/api-doc/slot-machine/take-and-gamble/take-and-gamble-controller.md b/api-doc/slot-machine/take-and-gamble/take-and-gamble-controller.md new file mode 100644 index 0000000..18a66c5 --- /dev/null +++ b/api-doc/slot-machine/take-and-gamble/take-and-gamble-controller.md @@ -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) | diff --git a/api-doc/slot-machine/take-and-gamble/take-and-gamble-model.md b/api-doc/slot-machine/take-and-gamble/take-and-gamble-model.md new file mode 100644 index 0000000..703b665 --- /dev/null +++ b/api-doc/slot-machine/take-and-gamble/take-and-gamble-model.md @@ -0,0 +1,16 @@ +--- +sidebar_position: 2 +--- + +# TakeOrGambleModel + +## Overview + +`TakeOrGambleModel` 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 `TakeOrGambleModel`. +- 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) \ No newline at end of file diff --git a/api-doc/slot-machine/take-and-gamble/take-and-gamble-view.md b/api-doc/slot-machine/take-and-gamble/take-and-gamble-view.md new file mode 100644 index 0000000..0db2826 --- /dev/null +++ b/api-doc/slot-machine/take-and-gamble/take-and-gamble-view.md @@ -0,0 +1,16 @@ +--- +sidebar_position: 3 +--- + +# TakeOrGambleView + +## Overview + +`TakeOrGambleView` 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 `TakeOrGambleView` 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) +