21 lines
465 B
Kotlin
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)
|
|
}
|
|
}
|
|
}
|
|
} |