|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.pesullivan.game.mill.engine.MillMove
public final class MillMove
A Nine Men's Morris implementation of Move
.
Nine Men's Morris moves are described by two spots: moveSpot0
and moveSpot1
.
Placing and taking moves are represented by moveSpot0
.
Sliding and flying moves are represented by start and end spots: moveSpot0
and moveSpot1
.
Constructor Summary | |
---|---|
MillMove()
Construct a move with MillBoard.NO_SPOT for each move spot. |
|
MillMove(int moveSpot0)
Construct a move at the given moveSpot0. |
|
MillMove(int moveSpot0,
int moveSpot1)
Construct a move at the given spots. |
Method Summary | |
---|---|
Move |
copy()
Return a copy of the move. |
int |
getMoveSpot0()
Get the spot to place a mill stone on, or to move a mill stone from. |
int |
getMoveSpot1()
Get the spot to slide or fly a mill stone to. |
boolean |
isSame(MillMove move)
Return true if the two moves are the same. |
boolean |
isSame(Move move)
Return true if the two moves are the same. |
void |
setFrom(int moveSpot0)
Set moveSpot0 based on the parameter and set moveSpot1 to MillBoard.NO_SPOT. |
void |
setFrom(int[] moveSpots)
Set this move based on the parameter. |
void |
setFrom(int moveSpot0,
int moveSpot1)
Set this move based on the parameters. |
void |
setFrom(MillMove move)
Set this move based on the parameter. |
void |
setFrom(Move move)
Set this move based on the parameter. |
void |
setFromJSON(org.json.simple.JSONObject jsonMove)
Set this move based on the parameter. |
org.json.simple.JSONObject |
toJSONObject()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MillMove()
public MillMove(int moveSpot0)
public MillMove(int moveSpot0, int moveSpot1)
Method Detail |
---|
public void setFromJSON(org.json.simple.JSONObject jsonMove)
Move
setFromJSON
in interface Move
public org.json.simple.JSONObject toJSONObject()
toJSONObject
in interface Move
public Move copy()
Move
copy
in interface Move
public boolean isSame(Move move)
Move
isSame
in interface Move
public boolean isSame(MillMove move)
public void setFrom(Move move)
Move
setFrom
in interface Move
public void setFrom(MillMove move)
public void setFrom(int moveSpot0, int moveSpot1)
public void setFrom(int[] moveSpots)
moveSpots
- holds moveSpot0 and moveSpot1.public void setFrom(int moveSpot0)
public int getMoveSpot0()
public int getMoveSpot1()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |