/**
 *
 */
package de.rico.adventure.actions;

import javax.media.opengl.GL;

import de.rico.adventure.entity.AbstractEntity;

/**
 * This class is the abstract base class for any kind of game action.
 * @author Frank Bruns
 */
public abstract class AbstractAction
{
	private AbstractEntity entity = null;

	/**
	 * Creates a new game action without a specified entity.
	 *
	 */
	public AbstractAction()
	{

	}

	/**
	 * Creates a new game action for the specified entity.
	 * @param e entity for this game action
	 */
	public AbstractAction(AbstractEntity e)
	{
		this.entity = e;
	}

	/**
	 * Returns the entity of the game action, if it has one,
	 * else <code>null</code>.
	 * @return entity of the game action, or <code>null</code>
	 */
	public AbstractEntity getEntity()
	{
		return this.entity;
	}

	/**
	 * Implementations of this method hold code that needs to be called
	 * before the game action can be removed from the queue (prematurely)
	 * without causing side effects.
	 *
	 */
	public abstract void finishUp();

	/**
	 * This method updates the game action
	 * @param elapsedTime time between two frames
	 */
	public abstract void update(long elapsedTime);

	/**
	 * This method renders the game action, if needed.
	 * @param gl
	 */
	public abstract void draw(GL gl);
}
