NecroGame/app/src/main/java/com/gc/necrogame/game/PurchaseQuantity.kt
2020-10-11 18:48:09 -04:00

21 lines
465 B
Kotlin

package com.gc.necrogame.game
import com.gc.necrogame.Purchasable
enum class PurchaseQuantity {
ONE,
TEN,
HUNDRED,
MAX;
companion object {
fun getAmount(q: PurchaseQuantity, purchasable: Purchasable, state: GameModel): Double {
return when (q) {
ONE -> 1.0
TEN -> 10.0
HUNDRED -> 100.0
MAX -> purchasable.maxPurcahsable(state)
}
}
}
}