Package net.alteiar.beans.dice

Examples of net.alteiar.beans.dice.DiceBag


    int diceCount = Integer.valueOf(diceCntStr);
    int diceValue = Integer.valueOf(diceValStr);
    int mod = Integer.valueOf(modStr);

    DiceBag bag = new DiceBag(mod);
    for (int i = 0; i < diceCount; ++i) {
      bag.addDice(new DiceSingle(diceValue));
    }

    CampaignClient.getInstance().getDiceRoller().roll(bag);

    return null;
View Full Code Here


  }

  @Override
  public void rollInitiative() {

    DiceBag bag = new DiceBag();
    int init = getCharacter().getInitiative();

    for (int i = 0; i < init; i++) {
      bag.addDice(new DiceSingle(6));
    }

    CampaignClient.getInstance().getDiceRoller().roll(bag);
    setInitiative(bag.getTotal());
  }
View Full Code Here

    putValue(LARGE_ICON_KEY, icon);
  }

  @Override
  public void actionPerformed(ActionEvent e) {
    DiceBag diceBag = new DiceBag(builder.getModifier());

    for (int i = 0; i < builder.getDiceCount(); i++) {
      diceBag.addDice(new DiceSingle(dice));
    }

    CampaignClient.getInstance().getDiceRoller().roll(diceBag);
  }
View Full Code Here

    this.add(dieButton);
  }

  private boolean rollDice() {
    boolean atLeastOneDieSelected = false;
    DiceBag bag = new DiceBag();
    for (Die die : this.dice) {
      if (die.isSelected()) {
        bag.addDice(die.getDice());
        atLeastOneDieSelected = true;
      }
    }

    CampaignClient.getInstance().getDiceRoller().roll(bag);
View Full Code Here

  }

  @Override
  public void rollInitiative() {
    DiceSingle dice = new DiceSingle(20);
    DiceBag bag = new DiceBag(dice, getCharacter().getInitMod());
    CampaignClient.getInstance().getDiceRoller().roll(bag);
    setInitiative(bag.getTotal());
  }
View Full Code Here

    dices.put(8, 2);

    TestListener listener = new TestListener(dices);
    roller.addPropertyChangeListener(listener);

    DiceBag bag = new DiceBag();
    for (Entry<Integer, Integer> entry : dices.entrySet()) {
      for (int i = 0; i < entry.getValue(); ++i) {
        bag.addDice(new DiceSingle(entry.getKey()));
      }
    }
    roller.roll(bag);

    while (listener.getCallCount() < 1) {
View Full Code Here

TOP

Related Classes of net.alteiar.beans.dice.DiceBag

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.