Rules

data class Rules(lottoPrizesStart: Int, vikingLottoPrizesStart: Int, euroJackpotPrizesStart: Int, jokerPrizesStart: Int, kenoRule: Rules.KenoPrizeRule, allOrNothingRule: Rules.AllOrNothingPrizeRule, retailPayoutLimit: Double)

Constructors

Link copied to clipboard
constructor(lottoPrizesStart: Int, vikingLottoPrizesStart: Int, euroJackpotPrizesStart: Int, jokerPrizesStart: Int, kenoRule: Rules.KenoPrizeRule, allOrNothingRule: Rules.AllOrNothingPrizeRule, retailPayoutLimit: Double)

Types

Link copied to clipboard
data class AllOrNothingPrizeRule(upperPrizesStartFrom: Int, lowerPrizesStartFrom: Int)
Link copied to clipboard
data class CorrectNumbersResult(val correctNumbersTotal: Int, val correctExtraNumbersTotal: Int, val correctNumbers: List<Int>, val correctExtraNumbers: List<Int>)
Link copied to clipboard
data class KenoPrizeRule(rowNumberCountFourOrLower: Int, rowNumberCountSixOrLower: Int, rowNumberCountEightOrLower: Int, rowNumberCountTenOrLower: Int, rowNumberCountTenSpecial: Int)

Functions

Link copied to clipboard
fun findCorrectNumbers(gameType: GameType, rowNumbers: List<Int>, rowExtraNumbers: List<Int> = emptyList(), drawNumbers: List<Int>, drawExtraNumbers: List<Int> = emptyList()): Rules.CorrectNumbersResult

Find correct numbers of a coupon row based on the GameType row numbers and draw numbers.

Link copied to clipboard
fun hasPrize(gameType: GameType, correctNumbers: Int, correctExtraNumbers: Int = 0, rowCount: Int = 0): Boolean

hasPrize will return true if a row for a given type has enough correct numbers to win a prize. Keno is the only game type that needs the row count. Joker game type, correct numbers needs to be after each other, so correct numbers is the biggest collection of correct numbers in a row.