soc.game
Class SOCGame.RollResult

java.lang.Object
  extended by soc.game.SOCGame.RollResult
Enclosing class:
SOCGame

public static class SOCGame.RollResult
extends java.lang.Object

Dice roll result, for reporting from SOCGame.rollDice(). Each game has 1 instance of this object, which is updated each turn.

Since:
2.0.00
Author:
Jeremy D Monin <jeremy@nand.net>

Field Summary
 int[] cloth
          Null, or distributed cloth (for game scenario SC_CLVI), in the same format as SOCVillage.distributeCloth(SOCGame).
 int diceA
          The dice numbers rolled, each 1 to 6.
 int diceB
          The dice numbers rolled, each 1 to 6.
 SOCResourceSet sc_piri_fleetAttackRsrcs
          When the pirate fleet moves in game scenario SOCGameOption.K_SC_PIRI, resources lost when they attack the player with an adjacent settlement or city (sc_piri_fleetAttackVictim).
 SOCPlayer sc_piri_fleetAttackVictim
          When the pirate fleet moves in game scenario SOCGameOption.K_SC_PIRI, they may attack the player with an adjacent settlement or city.
 java.util.Vector<SOCPlayer> sc_robPossibleVictims
          Robber/pirate fleet victims in some scenarios, otherwise null.
 
Constructor Summary
SOCGame.RollResult()
           
 
Method Summary
 void update(int dA, int dB)
          Convenience: Set diceA and dice, clear cloth.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

diceA

public int diceA
The dice numbers rolled, each 1 to 6.


diceB

public int diceB
The dice numbers rolled, each 1 to 6.


cloth

public int[] cloth
Null, or distributed cloth (for game scenario SC_CLVI), in the same format as SOCVillage.distributeCloth(SOCGame).


sc_robPossibleVictims

public java.util.Vector<SOCPlayer> sc_robPossibleVictims
Robber/pirate fleet victims in some scenarios, otherwise null.

When a 7 is rolled in game scenario SOCGameOption.K_SC_PIRI, there is no robber piece to move; the current player immediately picks another player with resources to steal from. In that situation, this field holds the list of possible victims, and gameState is SOCGame.WAITING_FOR_ROB_CHOOSE_PLAYER.

Moving the pirate fleet might also have a different victim, see sc_piri_fleetAttackVictim and sc_piri_fleetAttackRsrcs.

See Also:
SOCGame.getPossibleVictims()

sc_piri_fleetAttackVictim

public SOCPlayer sc_piri_fleetAttackVictim
When the pirate fleet moves in game scenario SOCGameOption.K_SC_PIRI, they may attack the player with an adjacent settlement or city. If no adjacent, or more than 1, nothing happens, and this field is null. Otherwise see sc_piri_fleetAttackRsrcs for the result.

Each time the dice is rolled, the fleet is moved and this field is updated; may be null.


sc_piri_fleetAttackRsrcs

public SOCResourceSet sc_piri_fleetAttackRsrcs
When the pirate fleet moves in game scenario SOCGameOption.K_SC_PIRI, resources lost when they attack the player with an adjacent settlement or city (sc_piri_fleetAttackVictim).

Each time the dice is rolled, the fleet is moved and this field is updated; may be null.

If the victim wins against the attack, they gain a resource of their choice, but that chosen resource would be in a different game state, not part of the RollResult.

Constructor Detail

SOCGame.RollResult

public SOCGame.RollResult()
Method Detail

update

public void update(int dA,
                   int dB)
Convenience: Set diceA and dice, clear cloth.