Package net.alteiar.beans.dice

Examples of net.alteiar.beans.dice.DiceRoller.addPropertyChangeListener()


  @Test(timeout = 1000)
  public void testSingleDice() {
    DiceRoller roller = CampaignClient.getInstance().getDiceRoller();

    TestListener listener = new TestListener(6, 1);
    roller.addPropertyChangeListener(listener);
    roller.roll(new DiceSingle(6));

    while (listener.getCallCount() < 1) {
      sleep(5);
    }
View Full Code Here


    HashMap<Integer, Integer> dices = new HashMap<Integer, Integer>();
    dices.put(6, 3);
    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()));
View Full Code Here

  @Test(timeout = 1000)
  public void testMultipleRoll() {
    DiceRoller roller = CampaignClient.getInstance().getDiceRoller();

    TestListener listener = new TestListener(6, 1);
    roller.addPropertyChangeListener(listener);
    roller.roll(new DiceSingle(6));
    roller.roll(new DiceSingle(6));
    roller.roll(new DiceSingle(6));

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

TOP
Copyright © 2018 www.massapi.com. 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.