evaluateRoll(table, playerBet, roll) {
      // Determine the override values on this bet.
      // On the "come out roll", the bet is according to overrideComeOut.
      // Odds on the "come out roll" for positive bets are off, negative bets are on.
      var override = this.overrideComeOut;
      var oddsOverride = this.isLose;
      // Now set the overrides based on player wishes and current game standing.
      if (this.hasPoint) {
        // This is a contract bet, and only the odds can be turned off.
        override = true;
        if (playerBet['override'] === true || playerBet['override'] === false) {
          oddsOverride = override;
        } else if (table['pointValue']) {
          oddsOverride = true;
        }
      } else if (playerBet['override'] === true || playerBet['override'] === false) {
        // The player has specifically requested a bet be always on or always off.
        override = playerBet['override'];
      } else if (table['pointValue']) {
        // A point is established; the bet is on.
        override = true;
      }
      for (var x=0; x<this.resolves.length; x++) {
        if (this.resolves[x]['rolls'].find(function(resRoll) { return resRoll.isEqual(roll); })) {
          var retPay = override ? Math.floor(this.resolves[x]['pay'] * playerBet['amount']) : 0;
          if (retPay > 0 && this['hasVig'] && !table['vigOnBet']) {
            // The 5% Commission is only ever paid on a win, and only on the main bet.
            if (this['isLose']) {
              // The 5% Commission is based from the win.
              var vig = Math.floor(retPay / 20) || 1;
            } else {
              // The 5% Commission is based from the bet.
              var vig = Math.floor(playerBet['amount'] / 20) || 1;
            }
            retPay -= vig;
          }
          if (this.resolves[x]['pay'] >= 0 && playerBet['oddsAmount'] > 0) {
            // Get the odds ratio for the original point before paying it.
            retPay += oddsOverride ? Math.floor(this.getBetOddsRatio() * playerBet['oddsAmount']) : 0;
          } else if (this.resolves[x]['pay'] < 0 && playerBet['oddsAmount'] > 0) {
            retPay += oddsOverride ? Math.floor(this.resolves[x]['pay'] * playerBet['oddsAmount']) : 0;
          }
          return retPay;
        }
      }
      return null;
    }
/**
     * Determine the outcome for a particular bet.
     * @param table [Game] The present game being played.
     * @param playerBet [PlayerBet] The bet that is being evaluated.
     * @param roll [DiceRoll] On what roll value the bet is being evaluated.
     * @return [Number] The amount paid in addition to a 'returned bet', or null if the bet is still active.
     */
Determine the outcome for a particular bet.
@param table [Game] The present game being played.
@param playerBet [PlayerBet] The bet that is being evaluated.
@param roll [DiceRoll] On what roll value the bet is being evaluated.
@return [Number] The amount paid in addition to a 'returned bet', or null if the bet is still active.
Determine the outcome for a particular bet . @param table [ Game ] The present game being played . @param playerBet [ PlayerBet ] The bet that is being evaluated . @param roll [ DiceRoll ] On what roll value the bet is being evaluated . @return [ Number ] The amount paid in addition to a ' returned bet ' or null if the bet is still active .
evaluateRoll(table, playerBet, roll) {
      var override = this.overrideComeOut;
      var oddsOverride = this.isLose;
      if (this.hasPoint) {
        override = true;
        if (playerBet['override'] === true || playerBet['override'] === false) {
          oddsOverride = override;
        } else if (table['pointValue']) {
          oddsOverride = true;
        }
      } else if (playerBet['override'] === true || playerBet['override'] === false) {
        override = playerBet['override'];
      } else if (table['pointValue']) {
        override = true;
      }
      for (var x=0; x<this.resolves.length; x++) {
        if (this.resolves[x]['rolls'].find(function(resRoll) { return resRoll.isEqual(roll); })) {
          var retPay = override ? Math.floor(this.resolves[x]['pay'] * playerBet['amount']) : 0;
          if (retPay > 0 && this['hasVig'] && !table['vigOnBet']) {
            if (this['isLose']) {
              var vig = Math.floor(retPay / 20) || 1;
            } else {
              var vig = Math.floor(playerBet['amount'] / 20) || 1;
            }
            retPay -= vig;
          }
          if (this.resolves[x]['pay'] >= 0 && playerBet['oddsAmount'] > 0) {
            retPay += oddsOverride ? Math.floor(this.getBetOddsRatio() * playerBet['oddsAmount']) : 0;
          } else if (this.resolves[x]['pay'] < 0 && playerBet['oddsAmount'] > 0) {
            retPay += oddsOverride ? Math.floor(this.resolves[x]['pay'] * playerBet['oddsAmount']) : 0;
          }
          return retPay;
        }
      }
      return null;
    }
evaluateRoll ( table , playerBet , roll ) { var override = this . overrideComeOut ; var oddsOverride = this . isLose ; if ( this . hasPoint ) { override = true ; if ( playerBet [ 'override' ] === true || playerBet [ 'override' ] === false ) { oddsOverride = override ; } else if ( table [ 'pointValue' ] ) { oddsOverride = true ; } } else if ( playerBet [ 'override' ] === true || playerBet [ 'override' ] === false ) { override = playerBet [ 'override' ] ; } else if ( table [ 'pointValue' ] ) { override = true ; } for ( var x = 0 ; x < this . resolves . length ; x ++ ) { if ( this . resolves [ x ] [ 'rolls' ] . find ( function ( resRoll ) { return resRoll . isEqual ( roll ) ; } ) ) { var retPay = override ? Math . floor ( this . resolves [ x ] [ 'pay' ] * playerBet [ 'amount' ] ) : 0 ; if ( retPay > 0 && this [ 'hasVig' ] && ! table [ 'vigOnBet' ] ) { if ( this [ 'isLose' ] ) { var vig = Math . floor ( retPay / 20 ) || 1 ; } else { var vig = Math . floor ( playerBet [ 'amount' ] / 20 ) || 1 ; } retPay -= vig ; } if ( this . resolves [ x ] [ 'pay' ] >= 0 && playerBet [ 'oddsAmount' ] > 0 ) { retPay += oddsOverride ? Math . floor ( this . getBetOddsRatio ( ) * playerBet [ 'oddsAmount' ] ) : 0 ; } else if ( this . resolves [ x ] [ 'pay' ] < 0 && playerBet [ 'oddsAmount' ] > 0 ) { retPay += oddsOverride ? Math . floor ( this . resolves [ x ] [ 'pay' ] * playerBet [ 'oddsAmount' ] ) : 0 ; } return retPay ; } } return null ; }
Determine the outcome for a particular bet.
Determine the outcome for a particular bet .
// Determine the override values on this bet. // On the "come out roll", the bet is according to overrideComeOut. // Odds on the "come out roll" for positive bets are off, negative bets are on. // Now set the overrides based on player wishes and current game standing. // This is a contract bet, and only the odds can be turned off. // The player has specifically requested a bet be always on or always off. // A point is established; the bet is on. // The 5% Commission is only ever paid on a win, and only on the main bet. // The 5% Commission is based from the win. // The 5% Commission is based from the bet. // Get the odds ratio for the original point before paying it.