Package org.ngengine.components
Class StallingComponent
java.lang.Object
org.ngengine.components.StallingComponent
A component that is never enabled and does nothing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
onDisable
(ComponentManager mng, Runner runner, DataStoreProvider dataStore) Called when the component is disabled.void
onEnable
(ComponentManager mng, Runner runner, DataStoreProvider dataStore, boolean firstTime, Object arg) Called when the component is enabled.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ngengine.components.Component
getId, getSlot, onAttached, onDetached, onNudge
-
Constructor Details
-
StallingComponent
public StallingComponent()
-
-
Method Details
-
onEnable
public void onEnable(ComponentManager mng, Runner runner, DataStoreProvider dataStore, boolean firstTime, Object arg) Description copied from interface:Component
Called when the component is enabled. This is the most important method of the component lifecycle, where the component's main logic is implemented.This method is called when the component is enabled, all its dependencies are satisfied, the fragments are initialized, and the resources are loaded.
- Specified by:
onEnable
in interfaceComponent<Object>
- Parameters:
mng
- - the ComponentManager to which this component is attachedrunner
- - the Runner that executes the logicdataStore
- - the DataStoreProvider for storing and retrieving data and cachesfirstTime
- - whether this is the first time the component is being enabledarg
- - an argument that can be passed when enabling this component, can be null
-
onDisable
Description copied from interface:Component
Called when the component is disabled.This should undo anything that was done in
Component.onEnable(org.ngengine.components.ComponentManager, org.ngengine.runner.Runner, org.ngengine.store.DataStoreProvider, boolean, T)
and reset the component state to allow future re-enabling.This method is called when the component is explicitly disabled or when one of its dependencies is disabled.
If $
invalid reference
#onDetach
It is always called before an enabled component is detached from the
ComponentManager
.
-