package com.yidian.common.chameleon

object ChameleonServiceManager {
    private val services:MutableSet<ChameleonEventService> = mutableSetOf()

    fun registerChameleonService(service:ChameleonEventService){
        services.add(service)
    }
    fun unregisterChameleonService(service:ChameleonEventService){
        services.remove(service)
    }
    fun unregisterAllChameleonService(){
        services.clear()
    }
    fun dispatchEvent(event:ChameleonEvent){
        services.forEach{
            it.dispatchEvent(event)
        }
    }
}