|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsoc.game.SOCMoveRobberResult
public class SOCMoveRobberResult
This class holds the results of moving the robber or pirate.
Specifically, the victim or possible victims, and
what was stolen.
Call SOCGame.getRobberyPirateFlag()
to see which one was moved.
Each game has 1 instance of this object, which is updated each time the robber or pirate is moved.
Field Summary | |
---|---|
(package private) int |
loot
Resource type of loot stolen, as in SOCResourceConstants , or -1 |
SOCResourceSet |
sc_piri_loot
When the pirate fleet moves in game scenario _SC_PIRI ,
the resources stolen from victim. |
(package private) java.util.Vector<SOCPlayer> |
victims
Victim, or possible victims, or empty or null; content type SOCPlayer |
Constructor Summary | |
---|---|
SOCMoveRobberResult()
Creates a new SOCMoveRobberResult object. |
Method Summary | |
---|---|
void |
clear()
Clear common fields for reuse of this object. |
int |
getLoot()
Get the type of resource stolen from the victim; undefined unless getVictims() .size() == 1. |
java.util.Vector<SOCPlayer> |
getVictims()
Get the victim (if any) or possible victims |
void |
setLoot(int l)
Set the type of resource stolen from the victim |
void |
setVictims(java.util.Vector<SOCPlayer> v)
Set the victim (if any) or possible victims |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.util.Vector<SOCPlayer> victims
SOCPlayer
int loot
SOCResourceConstants
, or -1
public SOCResourceSet sc_piri_loot
_SC_PIRI
,
the resources stolen from victim. Otherwise null and ignored.
When sc_piri_loot
is set, the other loot
field is -1.
When victims
is empty, ignore this field.
SOCGame.stealFromPlayerPirateFleet(int, int)
Constructor Detail |
---|
public SOCMoveRobberResult()
Method Detail |
---|
public void clear()
sc_piri_loot
.
public void setVictims(java.util.Vector<SOCPlayer> v)
v
- Victim or possible victims, may be empty or null; Vector of SOCPlayer
public java.util.Vector<SOCPlayer> getVictims()
SOCPlayer
public void setLoot(int l)
l
- type of resource stolen, as in SOCResourceConstants
,
or -1 if nothing stolen,
or SOCResourceConstants.CLOTH_STOLEN_LOCAL
for cloth.public int getLoot()
getVictims()
.size() == 1.
SOCResourceConstants
,
or -1 if nothing stolen,
or SOCResourceConstants.CLOTH_STOLEN_LOCAL
for cloth.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |