diff --git a/api-doc/intro.md b/api-doc/intro.md index 3f0ba36..875d941 100644 --- a/api-doc/intro.md +++ b/api-doc/intro.md @@ -3,6 +3,10 @@ id: intro sidebar_position: 0 --- -# Slot game API +# Slot Game API +## Slot Game Machine +* [Initialize Controller](slot-machine/initialize-controller) +* [Balance Controller](slot-machine/balance) +* [Bet Controller](slot-machine/bet-controller) To be written \ No newline at end of file diff --git a/api-doc/slot-machine/_category_.json b/api-doc/slot-machine/_category_.json new file mode 100644 index 0000000..e7418b9 --- /dev/null +++ b/api-doc/slot-machine/_category_.json @@ -0,0 +1,17 @@ +{ + "position": 1, + "label": "Slot Game Machine", + "collapsible": true, + "collapsed": true, + "link": { + "type": "generated-index", + "title": "Slot Game Machine", + "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", + "development environment" + ] + } +} \ No newline at end of file diff --git a/api-doc/slot-machine/balance/_category_.json b/api-doc/slot-machine/balance/_category_.json new file mode 100644 index 0000000..122f127 --- /dev/null +++ b/api-doc/slot-machine/balance/_category_.json @@ -0,0 +1,18 @@ +{ + "position": 2, + "label": "Balance", + "collapsible": true, + "collapsed": true, + "link": { + "type": "generated-index", + "title": "Balance", + "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", + "balance" + ] + } +} \ No newline at end of file diff --git a/api-doc/slot-machine/balance/balance-controller.md b/api-doc/slot-machine/balance/balance-controller.md new file mode 100644 index 0000000..227f773 --- /dev/null +++ b/api-doc/slot-machine/balance/balance-controller.md @@ -0,0 +1,176 @@ +--- +sidebar_position: 2 +--- + +# Balance Controller +## Index + +### Properties +* [savedCurrentPoint](#savedcurrentpoint) `Number` Current played bet. +* [savedFreePoint](#savedfreepoint) `Number` Current free point played bet. +* [isResume](#isresume) `Boolean` Indicates whether the game current state is resuming or not. + +### Methods + +* [onReplayHistoryClient](#onreplayhistoryclient) Indicates the game current state is resuming. +* [onResume](#onresume) Indicates the game current state is resuming. +* [onResumeEnd](#isresumeend) Indicates the game current state isn't resuming. +* [onDeposit](#ondeposit) Update the client balance when user deposit. +* [onConnected](#onconnected) Update the client balance when the game is connected. +* [onStartGame](#onstartgame) Show the client balance when the game is started. +* [onCollectDataReceived](#oncollectdatareceived)Update the client balance when the game is collected. +* [onBalanceDataReceived](#onbalancedatareceived) Update the client balance when get new balance data. +* [onBalanceChangeRateClicked](#onbalancechangerateclicked) Change the client balance rate. +* [updateBalance](#updatebalance) Update the client balance. +* [notifyBalance](#notifyblance) Notify the client balance. +* [placeBet](#placebet) Set current client bet. +* [clearBet](#clearbet) Clear current client bet

+* [onSpinStart](#onspinstart) Update the client balance when user spin. +* [onReplayHistory](#onreplayhistory) Indicates the game current state is resuming. +* [onReplayHistoryEnd](#onreplayhistoryend) Indicates the game current state isn't resuming. +* [onFastPlayDataReceived](#onfastokaydatareceived) Update the client balance when user playing Fast Play. + +## Details + +#### savedCurrentPoint +> Current played bet.
+ +| meta | description | +| :--- | :---------- | +| Type | [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) | +| 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.
+ +| meta | description | +| :--- | :---------- | +| Type | [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) | +| Defined in | [p4f-game-core/src/controller/balance-controller.js:13](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/controller/balance-controller.js#L13)| + +#### isResume +> Indicates whether the game state is not resumed.
+ +| meta | description | +| :--- | :---------- | +| Type | [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) | +| Defined in | [p4f-game-core/src/controller/balance-controller.js:14](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/controller/balance-controller.js#L14)| + +#### onReplayHistoryClient +> Indicates the game current state is resuming.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-game-core/src/controller/balance-controller.js:28](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/controller/balance-controller.js#L28)| + +#### onResume +> Indicates the game current state is resuming.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-game-core/src/controller/balance-controller.js:36](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/controller/balance-controller.js#L36)| + +#### onResumeEnd +> Indicates the game current state isn't resuming.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-game-core/src/controller/balance-controller.js:44](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/controller/balance-controller.js#L44)| + +#### onDeposit +> Update the client balance when user deposit.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-game-core/src/controller/balance-controller.js:52](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/controller/balance-controller.js#L52)| + +#### onConnected +> Update the client balance when the game is connected.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-game-core/src/controller/balance-controller.js:82](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/controller/balance-controller.js#L82)| + +#### onStartGame +> Show the client balance when the game is started.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-game-core/src/controller/balance-controller.js:90](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/controller/balance-controller.js#L90)| + +#### onCollectDataReceived +> Update the client balance when the game is collected.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-game-core/src/controller/balance-controller.js:99](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/controller/balance-controller.js#L99)| + +#### onBalanceDataReceived +> Update the client balance when get new balance data.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-game-core/src/controller/balance-controller.js:109](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/controller/balance-controller.js#L109)| + +#### onBalanceChangeRateClicked +> Change the client balance rate.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-game-core/src/controller/balance-controller.js:117](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/controller/balance-controller.js#L117)| + +#### updateBalance +> Update the client balance.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-game-core/src/controller/balance-controller.js:129](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/controller/balance-controller.js#L129)| + +#### notifyBalance +> Notify the client balance.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-game-core/src/controller/balance-controller.js:141](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/controller/balance-controller.js#L141)| + +#### placeBet +> Set current client bet.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-game-core/src/controller/balance-controller.js:151](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/controller/balance-controller.js#L151)| + +#### clearBet +> Clear current client bet.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-game-core/src/controller/balance-controller.js:180](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/controller/balance-controller.js#L180)| + +#### onSpinStart +> Update the client balance when user spin.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-slotty-core/src/controller/balance-controller.js:17](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/balance-controller.js#L17)| + +#### onReplayHistory +> Indicates the game current state is resuming.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-slotty-core/src/controller/balance-controller.js:29](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/balance-controller.js#L29)| + +#### onReplayHistoryEnd +>Indicates the game current state isn't resuming.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-slotty-core/src/controller/balance-controller.js:37](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/balance-controller.js#L37)| + +#### onFastPlayDataReceived +> Update the client balance.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-slotty-core/src/controller/balance-controller.js:45](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/balance-controller.js#L45)| \ No newline at end of file diff --git a/api-doc/slot-machine/balance/balance-model.md b/api-doc/slot-machine/balance/balance-model.md new file mode 100644 index 0000000..235583a --- /dev/null +++ b/api-doc/slot-machine/balance/balance-model.md @@ -0,0 +1,80 @@ +--- +sidebar_position: 2 +--- + +# Balance Model + +## Index + +### Properties +* [currentPoint](#currentpoint) `Number` Current point. +* [freePoint](#freepoint) `Number` 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. +* [isNumber](#isnumber) Indicates whether the value is number or not. + +## Details + +#### currentPoint +> Current point.
+ +| meta | description | +| :--- | :---------- | +| Type | [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) | +| 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.
+ +| meta | description | +| :--- | :---------- | +| Type | [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) | +| 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.
+ +| 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.
+ +| 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.
+ +| 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.
+ +| 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.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-game-core/src/model/balance-model.js:40](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/model/balance-model.js#L40)| + +#### isNumber +> Indicates whether the value is number or not.
+ +| meta | description | +| :--- | :---------- | +| Type | [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) | +| Defined in | [p4f-game-core/src/model/balance-model.js:46](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/model/balance-model.js#L46)| \ No newline at end of file diff --git a/api-doc/slot-machine/balance/balance-view.md b/api-doc/slot-machine/balance/balance-view.md new file mode 100644 index 0000000..95cc88a --- /dev/null +++ b/api-doc/slot-machine/balance/balance-view.md @@ -0,0 +1,19 @@ +--- +sidebar_position: 2 +--- + +# Balance View + +## Index + +### Methods +* [BalanceChangeRate](#balancechangerate) + +## Details + +#### BalanceChangeRate +> ... + +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-game-core/src/view/balance-view.js:12](https://gitea.plp19.com/cocos-core/p4f-game-core/src/branch/develop/src/view/balance-view.js#L11)| \ No newline at end of file diff --git a/api-doc/slot-machine/bet-controller.md b/api-doc/slot-machine/bet-controller.md new file mode 100644 index 0000000..c57ec40 --- /dev/null +++ b/api-doc/slot-machine/bet-controller.md @@ -0,0 +1,99 @@ +--- +sidebar_position: 3 +--- + +# Bet Controller + +## Index + +### Properties +* [isHistoryActivated](#ishistoryactivated) `Boolean` Current played bet. +* [availablePoint](#availablepoint) `Number` Current played bet. +* [waiterAutoSpin](#waiterautospin) `Timer` Current played bet. +* [betProcessorFactory](#betprocessorfactory) `BetProcessorFactory` Current played bet. +* [betProcessor](#betprocessor) `BetProcessor` Current played bet. + +### Methods + +* [CalculateTotalBet](#calculatetotalbet) Register events to get data from server. +* [onChangeBetMode](#onchangebetmode) Start game when connected succesfully. +* [getClampedBet](#getclampedbet) Set resume data when connected server. +* [_start](#_start) Send request data to server. +* [_registerEvent](#_registerevent) Start game when connected succesfully with resume data. +* [_complete](#_complete) Start game when connected succesfully with resume data. +* [setBetPoints](#setbetpoints) Set resume data when connected server. +* [setBetPoint](#setbetpoint) Set resume data when connected server. +* [notifyBetDataChanged](#notifybetdatachanged) Set resume data when connected server. +* [onAutoSpinDeactivated](#onautospindeactivated) Set resume data when connected server. +* [onBetMultiplierReceived](#onbetmultiplierreceived) Set resume data when connected server. +* [onFreeroundsDataReceived](#onfreeroundsdatareceived) Set resume data when connected server. +* [onMiniGameDataReceived](#onminigamedatareceived) Set resume data when connected server. +* [onResumeOrReplayGameRound](#onresumeorreplaygameround) Set resume data when connected server. +* [onBalanceChanged](#onbalancechanged) Set resume data when connected server. +* [onReplayHistoryClient](#onreplayhistoryclient) Set resume data when connected server. +* [onResume](#onresume) Indicates the game current state is resuming. +* [onReplayHistory](#onreplayhistory) Indicates the game current state is resuming. +* [onHistoryActivated](#onhistoryactivated) Indicates the game current state is resuming. +* [onHistoryDeactivated](#onhistorydeactivated) Indicates the game current state is resuming. +* [onStartGame](#onstartgame) Show the client balance when the game is started. +* [onAutoSpinActivated](#onautospinactivated) Show the client balance when the game is started. +* [onSpinClicked](#onspinclicked) Show the client balance when the game is started. +* [onOutcomeSelected](#onoutcomeselected) Show the client balance when the game is started. +* [onBetPointChanged](#onbetpointchanged) Show the client balance when the game is started. +* [onBetMultiplierChanged](#onbetmultiplierchanged) Show the client balance when the game is started. +* [onPaylineCountChanged](#onpaylinecountchanged) Show the client balance when the game is started. +* [getTotalBetPoint](#gettotalbetpoint) Show the client balance when the game is started. +* [spin](#spin) Show the client balance when the game is started. +* [onManualBuyBonusOpened](#onmanualbuybonusopened) Show the client balance when the game is started. +* [onManualBuyBonusClosed](#onmanualbuybonusclosed) Show the client balance when the game is started. +* [onManualBuyBonusChanged](#onmanualbuybonuschanged) Show the client balance when the game is started. +* [setBetByPowerPlayModel](#setbetbypowerplaymodel) Show the client balance when the game is started. + +## Details + +#### isHistoryActivated +> Current played bet.
+ +| meta | description | +| :--- | :---------- | +| Type | [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) | +| Defined in | [p4f-slotty-core/src/controller/bet-controller.js:35](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/bet-controller.js#L35)| + +#### availablePoint +> Register events to get data from server.
+ +| meta | description | +| :--- | :---------- | +| Type | [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) | +| Defined in | [p4f-slotty-core/src/controller/bet-controller.js:36](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/bet-controller.js#L36)| + +#### waiterAutoSpin +> Send request data to server.
+ +| 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/controller/bet-controller.js:37](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/bet-controller.js#L37)| + +#### betProcessorFactory +> Set resume data when connected server.
+ +| meta | description | +| :--- | :---------- | +| Type | [BetProcessorFactory](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/total-bet-processor/bet-processor-factory.js#L8) | +| Defined in | [p4f-slotty-core/src/controller/bet-controller.js:38](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/bet-controller.js#L38)| + +#### betProcessor +> Set resume data when connected server.
+ +| meta | description | +| :--- | :---------- | +| Type | [BetProcessor](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/total-bet-processor/bet-processor-factory.js#L30) | +| Defined in | [p4f-slotty-core/src/controller/bet-controller.js:39](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/bet-controller.js#L39)| + +#### CalculateTotalBet +> Start game when connected succesfully.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-slotty-core/src/controller/bet-controller.js:44](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/bet-controller.js#L44)| \ No newline at end of file diff --git a/api-doc/slot-machine/initialize-controller.md b/api-doc/slot-machine/initialize-controller.md new file mode 100644 index 0000000..e8ff296 --- /dev/null +++ b/api-doc/slot-machine/initialize-controller.md @@ -0,0 +1,63 @@ +--- +sidebar_position: 1 +--- + +# Initialize Controller + +## Index + +### Properties +* [resumeData ](#resumedata) `Object` Current played bet. + +### Methods + +* [_registerEvent](#_registerevent) Register events to get data from server. +* [_start](#_start) Send request data to server. +* [onConnected](#onconnected) Set resume data when connected server. +* [onStartGame](#onstartgame) Start game when connected succesfully. +* [startResumeGame](#startresumegame) Start game when connected succesfully with resume data. + +## Details + +#### resumeData +> Current played bet.
+ +| meta | description | +| :--- | :---------- | +| Type | [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) | +| Defined in | [p4f-slotty-core/src/controller/initialize-controller.js:12](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/initialize-controller.js#L12)| + +#### _registerEvent +> Register events to get data from server.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-slotty-core/src/controller/initialize-controller.js:17](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/initialize-controller.js#L17)| + +#### _start +> Send request data to server.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-slotty-core/src/controller/initialize-controller.js:24](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/initialize-controller.js#L24)| + +#### onConnected +> Set resume data when connected server.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-slotty-core/src/controller/initialize-controller.js:32](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/initialize-controller.js#L32)| + +#### onStartGame +> Start game when connected succesfully.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-slotty-core/src/controller/initialize-controller.js:38](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/initialize-controller.js#L38)| + +#### startResumeGame +> Start game when connected succesfully with resume data.
+ +| meta | description | +| :--- | :---------- | +| Defined in | [p4f-slotty-core/src/controller/initialize-controller.js:50](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/branch/develop/src/controller/initialize-controller.js#L50)| \ No newline at end of file