soc.game
Class SOCShip
java.lang.Object
soc.game.SOCPlayingPiece
soc.game.SOCRoad
soc.game.SOCShip
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class SOCShip
- extends SOCRoad
A ship playing piece, on the large sea board (SOCBoardLarge
).
To simplify some game code, ships are a subclass of roads.
Ships are open until their route has a settlement or city on both ends.
Ships can be moved any turn after the turn they're placed, until isClosed()
is true.
In scenario option _SC_PIRI
,
SOCShip
has no "isWarship" field: Ships are converted to warships in the
chronological order they're placed; see SOCGame.isShipWarship(SOCShip)
.
- Since:
- 2.0.00
- Author:
- Jeremy D Monin <jeremy@nand.net>
- See Also:
- Serialized Form
Field Summary |
private boolean |
isClosed
Is this ship part of an closed trade route, not an open one? |
private static long |
serialVersionUID
|
Fields inherited from class soc.game.SOCPlayingPiece |
board, CITY, coord, FORTRESS, MAXPLUSONE, MIN, pieceType, player, ROAD, SETTLEMENT, SHIP, specialVP, specialVPEvent, VILLAGE |
Method Summary |
boolean |
isClosed()
Is this ship part of a closed trade route, not an open one? |
void |
setClosed()
Call when this ship's trade route has been closed. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
isClosed
private boolean isClosed
- Is this ship part of an closed trade route, not an open one?
SOCShip
public SOCShip(SOCPlayer pl,
int edge,
SOCBoard board)
throws java.lang.IllegalArgumentException
- Make a new ship.
The ship is considered part of an open trade route, until
setClosed()
is called.
- Parameters:
pl
- player who owns the shipedge
- edge coordinateboard
- board if known; otherwise will extract from pl
- Throws:
java.lang.IllegalArgumentException
- if pl null, or board null and pl.board also null
isClosed
public boolean isClosed()
- Is this ship part of a closed trade route, not an open one?
- Returns:
- True if
setClosed()
has been called
setClosed
public void setClosed()
- Call when this ship's trade route has been closed.