createPlugin

Create a new plugin instance that will be added to the map. Only one instance of the same class type can be used. If there is already a plugin created using a certain class, that same instance will continue to be returned by this method.

Return

the created plugin instance

Parameters

clazz

plugin implementation class, has to extend MapPlugin

constructorArguments

pairs of argument classes and instances. If you'd like your plugin to be instantiated using different than no-arg constructor, you need to specify the precise argument classes and instances that are needed to call that constructor.

fun <T : MapPlugin> createPlugin(clazz: Class<T>, vararg constructorArguments: Array<out Pair<Class<*>, Any>>): T?