2019-06-12 23:43:36 +02:00
package moe.kageru.kagebot.features
2019-11-13 23:18:28 +01:00
class Features (
2019-11-14 15:10:30 +01:00
val welcome : WelcomeFeature ? = null ,
val timeout : TimeoutFeature ? = null ,
2023-08-14 10:14:19 +02:00
vc : TempVCFeature = TempVCFeature ( null ) ,
2019-11-13 23:18:28 +01:00
) {
2019-11-14 15:10:30 +01: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-11-14 15:10:30 +01:00
private val all = listOf ( welcome , debug , help , getConfig , setConfig , timeout , vc )
private val featureMap = mapOf (
" help " to help ,
" debug " to debug ,
" welcome " to welcome ,
" getConfig " to getConfig ,
" setConfig " to setConfig ,
" timeout " to timeout ,
2023-08-14 10:14:19 +02:00
" vc " to vc ,
2019-11-14 15:10:30 +01:00
)
2019-07-07 14:32:40 +02:00
2019-11-14 15:10:30 +01:00
fun findByString ( feature : String ) = featureMap [ feature ]
fun eventFeatures ( ) = all . filterIsInstance < EventFeature > ( )
2019-07-13 14:52:05 +02:00
}