예제 #1
0
  private void runComparison() {
    Calculations m = Calculations.createInstance();
    m.calculate(setup, gear);
    defaultDPS = m.getTotalDPS();

    Collection<Enchant> enchants;
    SlotType slotType = SlotType.Trinket;
    switch (slot) {
      case 0:
        slotType = SlotType.Head;
        break;
      case 2:
        slotType = SlotType.Shoulder;
        break;
      case 3:
        slotType = SlotType.Back;
        break;
      case 4:
        slotType = SlotType.Chest;
        break;
      case 7:
        slotType = SlotType.Wrist;
        break;
      case 8:
        slotType = SlotType.Hands;
        break;
      case 10:
        slotType = SlotType.Legs;
        break;
      case 11:
        slotType = SlotType.Feet;
        break;
      case 12:
      case 13:
        slotType = SlotType.Finger;
        break;
      case 16:
      case 17:
        slotType = SlotType.OneHand;
        break;
    }
    enchants = Enchant.findSlot(slotType);

    for (Enchant e : enchants) {
      gear.setEnchant(slot, e);
      m.calculate(setup, gear);
      e.setComparedDPS(m.getTotalDPS() - defaultDPS);
      comparedEnchants.add(e);
    }
    Collections.sort(comparedEnchants);
  }