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

commonMain.objects.science._allScience.kt Maven / Gradle / Ivy

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

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


internal fun EmojiFinder.addAllScience() {
    add(intArrayOf(0x2697, 0xfe0f), _Alembic)
    add(intArrayOf(0x2697), _Alembic)
    add(intArrayOf(0x1f9ea), _TestTube)
    add(intArrayOf(0x1f9eb), _PetriDish)
    add(intArrayOf(0x1f9ec), _Dna)
    add(intArrayOf(0x1f52c), _Microscope)
    add(intArrayOf(0x1f52d), _Telescope)
    add(intArrayOf(0x1f4e1), _SatelliteAntenna)
}

internal suspend fun SequenceScope.yieldAllScience() {
    yield(_Alembic)
    yield(_TestTube)
    yield(_PetriDish)
    yield(_Dna)
    yield(_Microscope)
    yield(_Telescope)
    yield(_SatelliteAntenna)
}

internal val countScience = 7

/**
 * All Emoji of the Objects: science subgroup.
*/
public fun Emoji.Companion.sequenceScience(): Sequence =
    sequence { yieldAllScience() }

/**
 * All Emoji of the Objects: science 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.listScience(): List =
    ArrayList(countScience).also { list -> sequenceScience().forEach { list.add(it) } }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy