package game.functions.trackStep;

import java.util.BitSet;

import game.Game;
import game.functions.dim.DimFunction;
import game.types.board.TrackStepType;
import game.types.state.GameType;
import game.util.directions.CompassDirection;
import other.context.Context;

/**
 * Returns a track step entry, which can be a dim function (including positive integer), 
 * compass direction or TrackStepType (Off/End/Repeat).
 * 
 * @author cambolbro
 */

// **
// ** Do not @Hide, or loses mapping in grammar!
// **

public interface TrackStepFunction extends GameType
{
	/**
	 * @param context The context.
	 * @return The range generated by this context.
	 */
	public TrackStep eval(final Context context);

	/**
	 * @return Integer value or dim function.
	 */
	public DimFunction dim();
	
	/**
	 * @return Compass direction.
	 */
	public CompassDirection dirn();
	
	/**
	 * @return Track step type: Off/End/Repeat.
	 */
	public TrackStepType step();

	/**
	 * @param game The game.
	 * @return Accumulated flags corresponding to the game concepts.
	 */
	public BitSet concepts(final Game game);

	/**
	 * @return Accumulated flags corresponding to read data in EvalContext.
	 */
	public BitSet readsEvalContextRecursive();

	/**
	 * @return Accumulated flags corresponding to write data in EvalContext.
	 */
	public BitSet writesEvalContextRecursive();

	/**
	 * @param game The game.
	 * @return True if a required ludeme is missing.
	 */
	public boolean missingRequirement(final Game game);

	/**
	 * @param game The game.
	 * @return True if the ludeme can crash the game during its play.
	 */
	public boolean willCrash(final Game game);
}
