package canvas.scene3d;


/** Actions attach to an {@link Actor} and perform some task, often over time.
 * @author Nathan Sweet */
abstract public class Action3D {
        
        /** Updates the action based on time. Typically this is called each frame by {@link Actor#act(float)}.
         * @param delta Time in seconds since the last frame.
         * @return true if the action is done. This method may continue to be called after the action is done. */
        abstract public boolean act (double delta);

        /** Sets the state of the action so it can be run again. */
        public void restart () {
        }

        /** @return null if the action is not attached to an actor. */
        public SceneNode3D getActor3d() {
    		return null;
        }

        /** Sets the actor this action will be used for. This is called automatically when an action is added to an actor. This is also
         * called with null when an action is removed from an actor. When set to null, if the action has a {@link #setPool(Pool) pool}
         * then the action is {@link Pool#free(Object) returned} to the pool (which calls {@link #reset()}) and the pool is set to null.
         * If the action does not have a pool, {@link #reset()} is not called.
         * <p>
         * This method is not typically a good place for a subclass to query the actor's state because the action may not be executed
         * for some time, eg it may be {@link DelayAction delayed}. The actor's state is best queried in the first call to
         * {@link #act(float)}. For a {@link TemporalAction}, use TemporalAction#begin(). */
        public void setActor3d(SceneNode3D actor3d) {
                
        }

        /** Resets the optional state of this action to as if it were newly created, allowing the action to be pooled and reused. State
         * required to be set for every usage of this action or computed during the action does not need to be reset.
         * <p>
         * The default implementation calls {@link #restart()}.
         * <p>
         * If a subclass has optional state, it must override this method, call super, and reset the optional state. */
        public void reset () {
               
        }

        public String toString () {
    		return null;

        }
        
}