|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsoc.game.SOCPlayingPiece
soc.game.SOCFortress
public class SOCFortress
A fortress playing piece, used on the large sea board (SOCBoardLarge) with some scenarios.
Fortresses are in a game only if scenario game option _SC_PIRI is set.
A player "owns" one fortress, but doesn't control it until after they have conquered the pirates
there and its getStrength() is 0. At that time it becomes a SOCSettlement.
New fortresses cannot be built after the game starts.
So, game.putPiece(SOCFortress) assumes initial placement.
For details of fortress recapture / conquest, see SOCGame.attackPirateFortress(SOCShip).
| Field Summary | |
|---|---|
private static long |
serialVersionUID
|
static int |
STARTING_STRENGTH
Default starting strength for a fortress (3). |
private int |
strength
What is this fortress' strength? Begins at STARTING_STRENGTH. |
| Fields inherited from class soc.game.SOCPlayingPiece |
|---|
board, CITY, coord, FORTRESS, MAXPLUSONE, MIN, pieceType, player, ROAD, SETTLEMENT, SHIP, specialVP, specialVPEvent, VILLAGE |
| Constructor Summary | |
|---|---|
SOCFortress(SOCPlayer pl,
int node,
SOCBoard board)
Make a new fortress, with strength STARTING_STRENGTH. |
|
| Method Summary | |
|---|---|
int |
getStrength()
Get the current strength of this fortress. |
void |
setStrength(int strength)
Set the current strength of this fortress. |
| Methods inherited from class soc.game.SOCPlayingPiece |
|---|
equals, getAdjacentEdges, getCoordinates, getPlayer, getPlayerNumber, getResourcesToBuild, getType, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
public static final int STARTING_STRENGTH
private int strength
STARTING_STRENGTH.
| Constructor Detail |
|---|
public SOCFortress(SOCPlayer pl,
int node,
SOCBoard board)
throws java.lang.IllegalArgumentException
STARTING_STRENGTH.
pl - Player who will own the fortressnode - node coordinate of fortressboard - board
java.lang.IllegalArgumentException - if board null| Method Detail |
|---|
public int getStrength()
public void setStrength(int strength)
strength - New strength
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||