org.gChess
Class Location
java.lang.Object
org.gChess.Location
public class Location
- extends java.lang.Object
Constructor Summary |
Location(int row,
int col)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
FORWARD
public static final int FORWARD
- See Also:
- Constant Field Values
FORWARD_RIGHT
public static final int FORWARD_RIGHT
- See Also:
- Constant Field Values
RIGHT
public static final int RIGHT
- See Also:
- Constant Field Values
BACK_RIGHT
public static final int BACK_RIGHT
- See Also:
- Constant Field Values
BACK
public static final int BACK
- See Also:
- Constant Field Values
BACK_LEFT
public static final int BACK_LEFT
- See Also:
- Constant Field Values
LEFT
public static final int LEFT
- See Also:
- Constant Field Values
FORWARD_LEFT
public static final int FORWARD_LEFT
- See Also:
- Constant Field Values
DOWN
public static final int DOWN
- See Also:
- Constant Field Values
UP
public static final int UP
- See Also:
- Constant Field Values
Location
public Location(int row,
int col)
getCol
public int getCol()
getRow
public int getRow()
setCol
public void setCol(int col)
setRow
public void setRow(int row)
isValid
public boolean isValid()
- Parameters:
loc
-
- Returns:
- true if
loc
is a valid location; false otherwise
equals
public boolean equals(Location other)
includedIn
public boolean includedIn(java.util.ArrayList<Location> locs)
getLocationInDir
public Location getLocationInDir(int dir)
setDirection
public void setDirection(int dir)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object