Artenus 2D Framework
Artenus Reference
Interface for all entities that can be added to a scene. Entities provide various functionality, including graphical, physical, or user interaction. A Scene is made up of a list of entities, and it uses them for processing graphics, animation, and user input.

See Also:

public interface Entity

Method Summary

Modifier and TypeMethod and Description
public booleanhasBehavior(Behaviors behavior)
Indicates whether this entity has the specified behavior.
public voidonAttach(Scene scene)
Called when this entity is associated with a scene.
public voidonDetach(Scene scene)
Called when this entity is dissociated with a scene.

Method Detail

hasBehavior
public boolean hasBehavior(
    Behaviors behavior
)
Indicates whether this entity has the specified behavior. If it does, it can be cast to the corresponding interface. Note that the return value can be transient and a fixed return value for a behavior is not guaranteed by the framework.
Parameters:
behaviorBehavior to be checked
Returns:
true if this entity has the behavior, false otherwise
See Also:
onAttach
public void onAttach(
    Scene scene
)
Called when this entity is associated with a scene.
Parameters:
sceneThe scene that currently contains the entity.
onDetach
public void onDetach(
    Scene scene
)
Called when this entity is dissociated with a scene.
Parameters:
sceneThe scene from which the entity is removed.