Class BattleDice

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

final class BattleDice extends Box
Class BattleDice displays dice rolls during a battle.
Author:
David Ripton, Romain Dolbeau
  • Field Details

    • dice

      private Chit[] dice
    • diceBox

      private final JPanel diceBox
    • missBox

      private final JPanel missBox
    • hitBox

      private final JPanel hitBox
    • attackerText

      private final JLabel attackerText
    • diceBoxTitledBorder

      private final TitledBorder diceBoxTitledBorder
    • diceResults

      private final List<BattleDice.DiceEntry> diceResults
    • currentEntry

      private int currentEntry
  • Constructor Details

    • BattleDice

      BattleDice()
  • Method Details

    • addValues

      void addValues(String battlePhaseDesc, String attackerDesc, String strikerDesc, String targetDesc, int targetNumber, List<String> rolls)
    • getDieImageName

      private String getDieImageName(String rollString)
    • showLastRoll

      void showLastRoll()
      Initialize and layout the components, in response to new data.
    • showCurrentRoll

      void showCurrentRoll()
    • averageMiss

      private int averageMiss()
    • rolls

      private List<String> rolls()
    • numDice

      private int numDice()
    • targetNumber

      private int targetNumber()
    • getCurrentResults

      private BattleDice.DiceEntry getCurrentResults()
    • targetDesc

      private String targetDesc()
    • attackerDesc

      private String attackerDesc()
    • battlePhaseDesc

      private String battlePhaseDesc()
    • strikerDesc

      private String strikerDesc()
    • rescale

      void rescale()
    • getMinimumSize

      public Dimension getMinimumSize()
      Overrides:
      getMinimumSize in class JComponent
    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class JComponent
    • setCurrentRoll

      public void setCurrentRoll(int pValue)
      Use to set the current roll in the history. Updates the control.
      Parameters:
      pValue -
    • getHistoryLength

      public int getHistoryLength()
      Returns:
      number of dice rolls stored in history