All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.objects.money._allMoney.kt Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
package org.kodein.emoji.objects.money

import org.kodein.emoji.Emoji
import org.kodein.emoji.EmojiFinder
import org.kodein.emoji.addSt1Variations
import org.kodein.emoji.addSt2Variations


internal fun EmojiFinder.addAllMoney() {
    add(intArrayOf(0x1f4b0), _MoneyBag)
    add(intArrayOf(0x1fa99), _Coin)
    add(intArrayOf(0x1f4b4), _YenBanknote)
    add(intArrayOf(0x1f4b5), _DollarBanknote)
    add(intArrayOf(0x1f4b6), _EuroBanknote)
    add(intArrayOf(0x1f4b7), _PoundBanknote)
    add(intArrayOf(0x1f4b8), _MoneyWithWings)
    add(intArrayOf(0x1f4b3), _CreditCard)
    add(intArrayOf(0x1f9fe), _Receipt)
    add(intArrayOf(0x1f4b9), _ChartIncreasingWithYen)
}

internal suspend fun SequenceScope.yieldAllMoney() {
    yield(_MoneyBag)
    yield(_Coin)
    yield(_YenBanknote)
    yield(_DollarBanknote)
    yield(_EuroBanknote)
    yield(_PoundBanknote)
    yield(_MoneyWithWings)
    yield(_CreditCard)
    yield(_Receipt)
    yield(_ChartIncreasingWithYen)
}

internal val countMoney = 10

/**
 * All Emoji of the Objects: money subgroup.
*/
public fun Emoji.Companion.sequenceMoney(): Sequence =
    sequence { yieldAllMoney() }

/**
 * All Emoji of the Objects: money subgroup.
 *
 * WARNING: This can be quite heavy to construct.
 * This method should be called in background and its result should be cached.
*/
public fun Emoji.Companion.listMoney(): List =
    ArrayList(countMoney).also { list -> sequenceMoney().forEach { list.add(it) } }

@Deprecated("Renamed listMoney.", replaceWith = ReplaceWith("listMoney()"), level = DeprecationLevel.WARNING)
public fun Emoji.Companion.allMoney(): List =
    listMoney()




© 2015 - 2025 Weber Informatics LLC | Privacy Policy