From cc588bbd2748b8c3f4ccadda40e30a75e8d4dd6d Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Wed, 23 Sep 2020 22:35:40 -0400 Subject: [PATCH] added another model --- .../com/wyattjmiller/dicerollerapp/Randomizer.kt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/src/main/java/com/wyattjmiller/dicerollerapp/Randomizer.kt b/app/src/main/java/com/wyattjmiller/dicerollerapp/Randomizer.kt index 5a74ab3..57468fe 100644 --- a/app/src/main/java/com/wyattjmiller/dicerollerapp/Randomizer.kt +++ b/app/src/main/java/com/wyattjmiller/dicerollerapp/Randomizer.kt @@ -1,4 +1,18 @@ package com.wyattjmiller.dicerollerapp +import kotlin.random.Random + class Randomizer { + private var mCoin: Array = Coin.values() + private var mDie: Array = Die.values() + + fun randomCoinFlip(): Int { + val rand = Random.nextInt(mCoin.size) + return rand + } + + fun randomDieRoll(): Int { + val rand = Random.nextInt(mDie.size) + return rand + } } \ No newline at end of file