2019-06-12 23:43:36 +02:00
package moe.kageru.kagebot.features
2019-10-19 11:32:28 +02:00
class Features ( val welcome : WelcomeFeature ? , val timeout : TimeoutFeature ? , vc : TempVCFeature = TempVCFeature ( null ) ) {
2019-10-18 21:56:31 +02:00
private val debug = DebugFeature ( )
private val help = HelpFeature ( )
private val getConfig = GetConfigFeature ( )
private val setConfig = SetConfigFeature ( )
2019-06-14 23:16:31 +02:00
2019-10-19 11:32:28 +02:00
private val all = listOf ( welcome , debug , help , getConfig , setConfig , timeout , vc )
2019-07-14 17:14:23 +02:00
private val featureMap = mapOf (
" help " to help ,
" debug " to debug ,
" welcome " to welcome ,
2019-07-14 17:27:43 +02:00
" getConfig " to getConfig ,
2019-07-23 21:50:55 +02:00
" setConfig " to setConfig ,
2019-10-19 11:32:28 +02:00
" timeout " to timeout ,
" vc " to vc
2019-07-14 17:14:23 +02:00
)
2019-07-07 14:32:40 +02:00
2019-07-11 21:05:35 +02:00
fun findByString ( feature : String ) = featureMap [ feature ]
2019-07-17 23:42:12 +02:00
fun eventFeatures ( ) = all . filterIsInstance < EventFeature > ( )
2019-10-18 21:56:31 +02:00
companion object {
val DEFAULT = Features ( null , null )
}
2019-07-13 14:52:05 +02:00
}