UNPKG

slotify.js

Version:

A video slot game session framework for JavaScript

30 lines (29 loc) 1.14 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GameSessionSimulationModel = void 0; var GameSessionSimulationModel = /** @class */ (function () { function GameSessionSimulationModel(session) { this._totalBet = 0; this._totalReturn = 0; this._rtp = 0; this._session = session; } GameSessionSimulationModel.prototype.getTotalBetAmount = function () { return this._totalBet; }; GameSessionSimulationModel.prototype.getTotalReturnAmount = function () { return this._totalReturn; }; GameSessionSimulationModel.prototype.updateTotalBetBeforePlay = function () { this._totalBet += this._session.getBet(); }; GameSessionSimulationModel.prototype.updateTotalReturnAfterPlay = function () { this._totalReturn += this._session.getWinningAmount(); this._rtp = this._totalReturn / this._totalBet; }; GameSessionSimulationModel.prototype.getRtp = function () { return this._rtp; }; return GameSessionSimulationModel; }()); exports.GameSessionSimulationModel = GameSessionSimulationModel;