pushers
Class PMove
java.lang.Object
boardgame.Move
pushers.PMove
- All Implemented Interfaces:
- java.lang.Cloneable
public class PMove
- extends Move
Represent a move in the Pushers game. This class does
no error checking with respect to the validity of moves.
|
Field Summary |
protected int |
dest
|
protected int |
orig
|
protected int |
player
|
|
Constructor Summary |
PMove(int player,
int orig,
int dest)
|
PMove(java.lang.String str)
|
|
Method Summary |
void |
fromString(java.lang.String str)
|
int |
getPlayerID()
Return the player who plays this move |
java.lang.String |
toPrettyString()
Represent as an easily interpreted string |
static java.lang.String |
toPrettyString(int player,
int orig,
int dest)
|
java.lang.String |
toTransportable()
Represent as an easily parsed string to be sent
over the network and stored in the logfile. |
static java.lang.String |
toTransportable(int player,
int orig,
int dest)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
player
protected int player
orig
protected int orig
dest
protected int dest
PMove
public PMove(int player,
int orig,
int dest)
throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
PMove
public PMove(java.lang.String str)
throws java.lang.NumberFormatException,
java.lang.IllegalArgumentException
- Throws:
java.lang.NumberFormatException
java.lang.IllegalArgumentException
getPlayerID
public int getPlayerID()
- Description copied from class:
Move
- Return the player who plays this move
- Specified by:
getPlayerID in class Move
toPrettyString
public static java.lang.String toPrettyString(int player,
int orig,
int dest)
toPrettyString
public java.lang.String toPrettyString()
- Description copied from class:
Move
- Represent as an easily interpreted string
- Specified by:
toPrettyString in class Move
toTransportable
public static java.lang.String toTransportable(int player,
int orig,
int dest)
toTransportable
public java.lang.String toTransportable()
- Description copied from class:
Move
- Represent as an easily parsed string to be sent
over the network and stored in the logfile.
- Specified by:
toTransportable in class Move
fromString
public void fromString(java.lang.String str)
throws java.lang.IllegalArgumentException,
java.lang.NumberFormatException
- Throws:
java.lang.IllegalArgumentException
java.lang.NumberFormatException