public class Behavior extends Action{

    private final ImageLibrary imageLibrary;
    private final World world;

    /**
     * Constructs an Action object with specified characteristics.
     * In the base program, this is not called directly.
     * Instead, the encapsulated 'create' method are used to create specific kinds.
     *
     * @param entity       The entity enacting the action.
     * @param world        The world in which the action occurs.
     * @param imageLibrary The image data that may be used by the action.
     */
    public Behavior(Entity entity, World world, ImageLibrary imageLibrary) {
        super(entity);
        this.world = world;
        this.imageLibrary = imageLibrary;
    }

    public World getWorld(){
        return world;
    }

    public ImageLibrary getImageLibrary(){
        return imageLibrary;
    }

    @Override
    public void execute(EventScheduler scheduler) {
        if( getEntity() instanceof ActiveEntity){
            ActiveEntity act = (ActiveEntity) getEntity();
            act.executeBehavior(world, imageLibrary, scheduler);
        }
    }


}
