Package dev.prozilla.pine.core.component
Interface ComponentsProvider
- All Superinterfaces:
ComponentsContext
- All Known Implementing Classes:
AnimationData,AudioEffectPlayer,AudioPlayer,BorderImage,ButtonNode,CameraControlData,CameraData,Component,DevConsoleData,DynamicText,FrameNode,GridGroup,ImageNode,LayoutNode,LayoutNodeStyle,MultiTileRenderer,Node,NodeRoot,NodeStyle,NodeStyleBase,ParticleBurstEmitter,ParticleEmitter,ParticleFlowEmitter,ParticleRenderer,RectRenderer,SpriteRenderer,TextInputNode,TextNode,TileRenderer,TooltipNode,Transform
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Interface with utility methods for finding certain components in the current context.
-
Method Summary
Modifier and TypeMethodDescriptiondefault <ComponentType extends Component>
ComponentTypegetComponent(Class<ComponentType> componentClass) Gets a component of a given class.default <ComponentType extends Component>
ComponentTypegetComponentInParent(Class<ComponentType> componentClass) default <ComponentType extends Component>
ComponentTypegetComponentInParent(Class<ComponentType> componentClass, boolean recursive) getComponents(Class<ComponentType> componentClass) Gets all components of a given class.getComponentsInChildren(Class<ComponentType> componentClass)
-
Method Details
-
getEntity
Entity getEntity() -
getComponentInParent
default <ComponentType extends Component> ComponentType getComponentInParent(Class<ComponentType> componentClass) - Specified by:
getComponentInParentin interfaceComponentsContext
-
getComponentInParent
default <ComponentType extends Component> ComponentType getComponentInParent(Class<ComponentType> componentClass, boolean recursive) - Specified by:
getComponentInParentin interfaceComponentsContext
-
getComponentsInChildren
default <ComponentType extends Component> List<ComponentType> getComponentsInChildren(Class<ComponentType> componentClass) - Specified by:
getComponentsInChildrenin interfaceComponentsContext
-
getComponent
default <ComponentType extends Component> ComponentType getComponent(Class<ComponentType> componentClass) Description copied from interface:ComponentsContextGets a component of a given class.- Specified by:
getComponentin interfaceComponentsContext- Parameters:
componentClass- Class of the component- Returns:
- Component of the given class, or null if there isn't one.
-
getComponents
default <ComponentType extends Component> List<ComponentType> getComponents(Class<ComponentType> componentClass) Description copied from interface:ComponentsContextGets all components of a given class.- Specified by:
getComponentsin interfaceComponentsContext- Parameters:
componentClass- Class of the components- Returns:
- Components of the given class.
-