--- sidebar_position: 2 --- # Bonus Game Model ## Index ### Properties * [random](#random) `Object` Stores RNG outcome data. * [bonusData](#bonusdata) `Object` Stores bonus game result details. * [currentSelectionItem](#currentselectionitem) `Number` Index of current selected item. * [lifePoint](#lifepoint) `Number` Remaining life in the bonus game. * [type](#type) `Number` Type of bonus game. ### Methods * [SetRandom](#setrandom) Sets the random number. * [GetRandom](#getrandom) Returns the stored random data. * [SetLifePoint](#setlifepoint) Sets the number of remaining life points. * [GetLifePoint](#getlifepoint) Returns the current life points. * [SetType](#settype) Sets the bonus game type. * [GetType](#gettype) Returns the current type. * [SetCurrentSelectionItem](#setcurrentselectionitem) Sets the index of the selected item. * [GetCurrentSelectionItem](#getcurrentselectionitem) Returns the selected item index. * [SetBonusData](#setbonusdata) Sets the bonus data object. * [GetBonusData](#getbonusdata) Gets the full bonus data object. * [GetTotalWinPoint](#gettotalwinpoint) Returns total win points from bonus data. * [CheckBonusEnd](#checkbonusend) Checks if bonus game has ended. * [GetResultData](#getresultdata) Returns the current turn result data. * [GetBonusTurnItem](#getbonusturnitem) Returns the selected item for current bonus turn. * [GetBonusTurnWinPoint](#getbonusturnwinpoint) Returns the win point of current bonus turn. * [GetBonusTurnLifePoint](#getbonusturnlifepoint) Returns the life point remaining for current bonus turn. * [GetBonusTurnPayout](#getbonusturnpayout) Returns the payout of the current bonus turn. --- ## Details ### Properties #### random > Stores RNG outcome data. | meta | description | | :--- | :---------- | | Defined in | [p4f-slotty-core/src/model/bonus-game-model.js#L9](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/bonus-game-model.js#L9) | #### bonusData > Stores bonus game result details. | meta | description | | :--- | :---------- | | Defined in | [p4f-slotty-core/src/model/bonus-game-model.js#L10](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/bonus-game-model.js#L10) | #### currentSelectionItem > Index of current selected item. | meta | description | | :--- | :---------- | | Defined in | [p4f-slotty-core/src/model/bonus-game-model.js#L11](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/bonus-game-model.js#L11) | ### Methods #### SetRandom Sets the random number. | meta | description | | :--- | :---------- | | Defined in | [p4f-slotty-core/src/model/bonus-game-model.js#L18](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/bonus-game-model.js#L18) |

**Parameters** * `random` [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)

#### GetRandom Returns the stored random data. | meta | description | | :--- | :---------- | | Returns | [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) | | Defined in | [p4f-slotty-core/src/model/bonus-game-model.js#L24](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/bonus-game-model.js#L24) | #### SetLifePoint Sets the number of remaining life points. | meta | description | | :--- | :---------- | | Defined in | [p4f-slotty-core/src/model/bonus-game-model.js#L30](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/bonus-game-model.js#L30) |

**Parameters** * `lifePoint` [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)

#### GetLifePoint Returns the current life points. | meta | description | | :--- | :---------- | | Returns | [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) | | Defined in | [p4f-slotty-core/src/model/bonus-game-model.js#L36](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/bonus-game-model.js#L36) | #### SetType Sets the bonus game type. | meta | description | | :--- | :---------- | | Defined in | [p4f-slotty-core/src/model/bonus-game-model.js#L42](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/bonus-game-model.js#L42) |

**Parameters** * `type` [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)

#### GetType Returns the current type. | meta | description | | :--- | :---------- | | Returns | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) | | Defined in | [p4f-slotty-core/src/model/bonus-game-model.js#L48](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/bonus-game-model.js#L48) | #### SetCurrentSelectionItem Sets the index of the selected item. | meta | description | | :--- | :---------- | | Defined in | [p4f-slotty-core/src/model/bonus-game-model.js#L54](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/bonus-game-model.js#L54) |

**Parameters** * `selectionIndex` [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)

#### GetCurrentSelectionItem Returns the selected item index. | meta | description | | :--- | :---------- | | Returns | [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) | | Defined in | [p4f-slotty-core/src/model/bonus-game-model.js#L60](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/bonus-game-model.js#L60) | #### SetBonusData Sets the bonus data object. | meta | description | | :--- | :---------- | | Defined in | [p4f-slotty-core/src/model/bonus-game-model.js#L66](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/bonus-game-model.js#L66) | #### GetBonusData Gets the full bonus data object. | meta | description | | :--- | :---------- | | Defined in | [p4f-slotty-core/src/model/bonus-game-model.js#L72](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/bonus-game-model.js#L72) | #### GetTotalWinPoint Returns total win points from bonus data. | meta | description | | :--- | :---------- | | Defined in | [p4f-slotty-core/src/model/bonus-game-model.js#L78](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/bonus-game-model.js#L78) | #### CheckBonusEnd Checks if bonus game has ended. | meta | description | | :--- | :---------- | | Defined in | [p4f-slotty-core/src/model/bonus-game-model.js#L84](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/bonus-game-model.js#L84) | #### GetResultData Returns the current turn result data. | meta | description | | :--- | :---------- | | Defined in | [p4f-slotty-core/src/model/bonus-game-model.js#L90](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/bonus-game-model.js#L90) | #### GetBonusTurnItem Returns the selected item for current bonus turn. | meta | description | | :--- | :---------- | | Defined in | [p4f-slotty-core/src/model/bonus-game-model.js#L96](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/bonus-game-model.js#L96) | #### GetBonusTurnWinPoint Returns the win point of current bonus turn. | meta | description | | :--- | :---------- | | Defined in | [p4f-slotty-core/src/model/bonus-game-model.js#L102](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/bonus-game-model.js#L102) | #### GetBonusTurnLifePoint Returns the life point remaining for current bonus turn. | meta | description | | :--- | :---------- | | Defined in | [p4f-slotty-core/src/model/bonus-game-model.js#L111](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/bonus-game-model.js#L111) | #### GetBonusTurnPayout Returns the payout of the current bonus turn. | meta | description | | :--- | :---------- | | Defined in | [p4f-slotty-core/src/model/bonus-game-model.js#L114](https://gitea.plp19.com/cocos-core/p4f-slotty-core/src/commit/7fbf58bf2ad8edec4258757b353151b638c96652/src/model/bonus-game-model.js#L114) |