Package org.ngengine.components
Interface ComponentUpdater
- All Known Implementing Classes:
AppComponentUpdater
,AppViewPortComponentUpdater
public interface ComponentUpdater
An interface to update components in the component manager.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canUpdate
(ComponentManager componentManager, Component component) Check if the component can be updated by this updater.void
render
(ComponentManager componentManager, Component component) Call the render method for the component in the given component manager.void
update
(ComponentManager componentManager, Component component, float tpf) Update the component in the given component manager.
-
Method Details
-
canUpdate
Check if the component can be updated by this updater. This is used to determine if the component is compatible with this updater and can be updated without issues. If the component is not compatible, it will not be updated and the component manager will call the next available updater in the chain.- Parameters:
componentManager
- the component managercomponent
- the component to check- Returns:
- true if the component can be updated, false otherwise
-
update
Update the component in the given component manager. This method is called every frame to update the component's state.- Parameters:
componentManager
- the component managercomponent
- the component to updatetpf
- time per frame, used for time-based updates
-
render
Call the render method for the component in the given component manager. This method is called during the render phase to perform low-level rendering logic for the component.- Parameters:
componentManager
- the component managercomponent
- the component to render
-