|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectMove
public class Move
A class encapsulating a player move during the game.
| Field Summary | |
|---|---|
static int |
NONE
Constant representing no move is made on this turn (loses against anything else). |
static int |
PAPER
Constant representing the paper. |
static int |
ROCK
Constant representing the rock. |
static int |
SCISSORS
Constant representing the scissors. |
| Constructor Summary | |
|---|---|
Move(int type)
Constructs a game move. |
|
| Method Summary | |
|---|---|
boolean |
beats(Move m)
Returns true if this Move beats the given Move. |
int |
getType()
Returns the type of this move. |
java.lang.String |
toString()
Returns the type of move it was. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int NONE
public static final int ROCK
public static final int PAPER
public static final int SCISSORS
| Constructor Detail |
|---|
public Move(int type)
type - the type of move; either NONE, ROCK, PAPER, or SCISSORS.| Method Detail |
|---|
public int getType()
public boolean beats(Move m)
m - the move to compare to.public java.lang.String toString()
toString in class java.lang.Object
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||