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

xyz.cssxsh.mirai.arknights.command.ArknightsHelperCommand.kt Maven / Gradle / Ivy

There is a newer version: 2.3.1
Show newest version
package xyz.cssxsh.mirai.arknights.command

import net.mamoe.mirai.console.command.*

sealed interface ArknightsHelperCommand : Command {

    companion object : Collection {
        private val commands by lazy {
            ArknightsHelperCommand::class.sealedSubclasses.mapNotNull { kClass -> kClass.objectInstance }
        }

        override val size: Int get() = commands.size

        override fun contains(element: ArknightsHelperCommand): Boolean = commands.contains(element)

        override fun containsAll(elements: Collection): Boolean = commands.containsAll(elements)

        override fun isEmpty(): Boolean = commands.isEmpty()

        override fun iterator(): Iterator = commands.iterator()

        operator fun get(name: String): ArknightsHelperCommand = commands.first { it.primaryName.equals(name, true) }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy