mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 16:23:48 +00:00
updates in slot machine utils
This commit is contained in:
parent
f8b3c44146
commit
41b4d29917
@ -5,6 +5,10 @@
|
|||||||
* `Common`:
|
* `Common`:
|
||||||
* `Version`:
|
* `Version`:
|
||||||
* `MicroUtils`: `0.4.24` -> `0.4.25`
|
* `MicroUtils`: `0.4.24` -> `0.4.25`
|
||||||
|
* `Extensions Utils`:
|
||||||
|
* `SlotMachineReelImages` has been renamed to `SlotMachineReelImage`
|
||||||
|
* `SlotMachineReelImage` got two built-in parameters: `text` and `number`
|
||||||
|
* New extension `String.asSlotMachineReelImage`
|
||||||
|
|
||||||
## 0.32.5
|
## 0.32.5
|
||||||
|
|
||||||
|
@ -6,16 +6,30 @@ import dev.inmo.tgbotapi.types.dice.SlotMachineDiceAnimationType
|
|||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import kotlinx.serialization.Transient
|
import kotlinx.serialization.Transient
|
||||||
|
|
||||||
enum class SlotMachineReelImages {
|
/**
|
||||||
BAR, BERRIES, LEMON, SEVEN
|
* @param text Is a text representation
|
||||||
|
* @param number Internal representation of reel
|
||||||
|
*/
|
||||||
|
enum class SlotMachineReelImage(val text: String, val number: Int) {
|
||||||
|
BAR("[bar]", 0),
|
||||||
|
BERRIES("\uD83C\uDF52", 1),
|
||||||
|
LEMON("\uD83C\uDF4B", 2),
|
||||||
|
SEVEN("7", 3)
|
||||||
}
|
}
|
||||||
|
@Deprecated("Renamed", ReplaceWith("SlotMachineReelImage", "dev.inmo.tgbotapi.extensions.utils.SlotMachineReelImage"))
|
||||||
|
typealias SlotMachineReelImages = SlotMachineReelImage
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return First [SlotMachineReelImage] with [SlotMachineReelImage.number] equal to receiver OR [SlotMachineReelImage.SEVEN]
|
||||||
|
*/
|
||||||
val Int.asSlotMachineReelImage
|
val Int.asSlotMachineReelImage
|
||||||
get() = when (this) {
|
get() = SlotMachineReelImage.values().firstOrNull { it.number == this } ?: SlotMachineReelImage.SEVEN
|
||||||
0 -> SlotMachineReelImages.BAR
|
|
||||||
1 -> SlotMachineReelImages.BERRIES
|
/**
|
||||||
2 -> SlotMachineReelImages.LEMON
|
* @return First [SlotMachineReelImage] with [SlotMachineReelImage.text] equal to receiver OR [SlotMachineReelImage.SEVEN]
|
||||||
else -> SlotMachineReelImages.SEVEN
|
*/
|
||||||
}
|
val String.asSlotMachineReelImage
|
||||||
|
get() = SlotMachineReelImage.values().firstOrNull { it.text == this } ?: SlotMachineReelImage.SEVEN
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class SlotMachineResult(
|
data class SlotMachineResult(
|
||||||
|
Loading…
Reference in New Issue
Block a user