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 TypeMethodDescriptionvoidonDisable(ComponentManager mng, Runner runner, DataStoreProvider dataStore) Called when the component is disabled.voidonEnable(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, waitMethods 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:ComponentCalled 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:
onEnablein 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:ComponentCalled 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 $
is not implemented, this method should take care of cleaning up all resources to prevent leaks.invalid reference
#onDetachIt is always called before an enabled component is detached from the
ComponentManager.
-