Class Move
java.lang.Object
|
+--Move
- public class Move
- extends java.lang.Object
Move for Gamed, GameClient.
- Version:
- $Revision: 1.4 $
- Author:
- Bart Massey
Field Summary |
int |
x1
Source square coordinates in the range 0-7, 0-7,
where the first coordinate is the column (x) value,
and the second is the row (y) value. |
int |
x2
Destination square coordinates in the range 0-7, 0-7,
where the first coordinate is the column (x) value,
and the second is the row (y) value. |
int |
y1
Source square coordinates in the range 0-7, 0-7,
where the first coordinate is the column (x) value,
and the second is the row (y) value. |
int |
y2
Destination square coordinates in the range 0-7, 0-7,
where the first coordinate is the column (x) value,
and the second is the row (y) value. |
Constructor Summary |
Move(int x1,
int y1,
int x2,
int y2)
Create a move object from the given starting and
ending coordinates in the range 0-7. |
Move(java.lang.String desc)
Create a move object from a description of the
form "coord-coord" where "coord" is an algebraic
square number. |
Method Summary |
java.lang.String |
name()
Get a description of the move object. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
x1
public int x1
- Source square coordinates in the range 0-7, 0-7,
where the first coordinate is the column (x) value,
and the second is the row (y) value.
y1
public int y1
- Source square coordinates in the range 0-7, 0-7,
where the first coordinate is the column (x) value,
and the second is the row (y) value.
x2
public int x2
- Destination square coordinates in the range 0-7, 0-7,
where the first coordinate is the column (x) value,
and the second is the row (y) value.
y2
public int y2
- Destination square coordinates in the range 0-7, 0-7,
where the first coordinate is the column (x) value,
and the second is the row (y) value.
Move
public Move(java.lang.String desc)
- Create a move object from a description of the
form "coord-coord" where "coord" is an algebraic
square number.
- Parameters:
desc
- Move description.
Move
public Move(int x1,
int y1,
int x2,
int y2)
- Create a move object from the given starting and
ending coordinates in the range 0-7.
- Parameters:
x1
- Starting column.y1
- Starting row.x1
- Ending column.y1
- Ending row.
name
public java.lang.String name()
- Get a description of the move object.
- Returns:
- String of the form "coord-coord" where
the coords are the starting and ending
move coordinates.