Class EntityNavigator
java.lang.Object
de.gurkenlabs.litiengine.entities.behavior.EntityNavigator
- All Implemented Interfaces:
IRenderable,IUpdateable
-
Constructor Summary
ConstructorsConstructorDescriptionEntityNavigator(IMobileEntity entity) Instantiates a new entity navigator without a pre-initialized PathFinder.EntityNavigator(IMobileEntity entity, PathFinder pathFinder) Instantiates a new entity navigator. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNavigationListener(NavigationListener listener) voidcancelNavigation(Predicate<IMobileEntity> predicate) floatgetPath()booleanbooleanbooleanvoidremoveNavigationListener(NavigationListener listener) voidrender(Graphics2D g) Renders the visual contents of this instance onto the provided graphics context.voidrotateTowards(Point2D target) voidsetAcceptableError(float acceptableError) voidstop()voidupdate()This method is called by the game loop on all objects that are attached to the loop.
-
Constructor Details
-
EntityNavigator
Instantiates a new entity navigator.- Parameters:
entity- The entity that will be navigated by this instancepathFinder- The pathfinder that is used to navigate the entity
-
EntityNavigator
Instantiates a new entity navigator without a pre-initialized PathFinder.- Parameters:
entity- The entity that will be navigated by this instance
-
-
Method Details
-
getEntity
-
getPath
-
getPathFinder
-
getAcceptableError
public float getAcceptableError() -
render
Description copied from interface:IRenderableRenders the visual contents of this instance onto the provided graphics context.If an
Entityimplements this interface, this method will be called right after the entity was rendered from the environment. Allowing for a custom rendering mechanism.This interface can be implemented in general by anything that should be rendered to the game's screen.
- Specified by:
renderin interfaceIRenderable- Parameters:
g- The current graphics object onto which this instance will render its visual contents.- See Also:
-
rotateTowards
-
setAcceptableError
public void setAcceptableError(float acceptableError) -
stop
public void stop() -
update
public void update()Description copied from interface:IUpdateableThis method is called by the game loop on all objects that are attached to the loop. It's called on every tick of the loop and the frequency can be configured using theClientConfiguration.- Specified by:
updatein interfaceIUpdateable- See Also: