override fun onCreate() {
super.onCreate()
componentManager.registerComponent<MyComponent>(MyComponent.Companion)
}
class ComponentManager
ComponentManager
()
|
Signature
constructor() Returns ComponentManager |
assertComponent
(
clazz
)
|
Asserts that a component class is registered.
Signature
fun assertComponent(clazz: KClass<*>) Parameters clazz: KClass
The Kotlin class to check
Throws IllegalArgumentException
If the component class is not registered
|
checkComponent
(
clazz
)
|
Checks if a component class is registered.
Signature
fun checkComponent(clazz: KClass<*>): Boolean Parameters clazz: KClass
The Kotlin class to check
Returns Boolean
True if the component is registered, false otherwise
|
registerComponent
(
clazz
, name
, sendRate
, companionObjectInstance
)
|
This method registers a component class with the ComponentManager, making it available for use with entities. It also registers the component's attributes with the DataModel and configures metadata settings.
Signature
fun registerComponent(clazz: KClass<*>, name: String, sendRate: SendRate, companionObjectInstance: ComponentCompanion) Parameters clazz: KClass
The Kotlin class of the component
name: String
The name of the component
sendRate: SendRate |
registerComponent
(
companionObjectInstance
, sendRate
)
|
Registers a component with the ComponentManager using reified type parameters.
Signature
inline fun <T : ComponentBase> registerComponent(companionObjectInstance: ComponentCompanion, sendRate: SendRate = SendRate.DEFAULT) Parameters sendRate: SendRate
The network synchronization rate for this component (defaults to DEFAULT)
|