
/**
 * Direction - a direction enumeration useful for orthogonal (up, down, right, left) movement direction on a grid.
 * @author Todd W. Neller
 * @version 1.1
 *

Copyright (C) 2013 Todd W. Neller

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

Information about the GNU General Public License is available online at:
  http://www.gnu.org/licenses/
To receive a copy of the GNU General Public License, write to the Free
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.

 */
public enum Direction {
	RIGHT(0, 1, 'r'), UP(-1, 0, 'u'), LEFT(0, -1, 'l'), DOWN(1, 0, 'd'); // directions
	
	/**
	 * direction row change
	 */
	public final int D_ROW;
	
	/**
	 * direction column change
	 */
	public final int D_COL;
	
	/**
	 * direction character representation 
	 */
	public final char CHAR;
	
	/**
	 * Set the Direction row and column changes.
	 * @param dRow direction row change
	 * @param dCol direction column change
	 */
	Direction(int dRow, int dCol, char character) {
		D_ROW = dRow;
		D_COL = dCol;
		CHAR = character;
	}

	/* (non-Javadoc)
	 * @see java.lang.Enum#toString()
	 */
	public String toString() {
		return Character.toString(CHAR);
	}
	
}
