private int recalculate(String method,WeaponTypeWrapper weapon,int attackSpeed,int time){
  int finalTime=0;
  TreeMap<WeaponType,float[]> list=new TreeMap<WeaponType,float[]>();
  float dagger[]={600f,1200f};
  list.put(WeaponType.DAGGER_1H,dagger);
  float mace[]={750f,1500f};
  list.put(WeaponType.MACE_1H,mace);
  list.put(WeaponType.GUN_1H,mace);
  list.put(WeaponType.TOOLHOE_1H,mace);
  float sword1h[]={700f,1400f};
  list.put(WeaponType.SWORD_1H,sword1h);
  float bookorb[]={1100f,2200f};
  list.put(WeaponType.BOOK_2H,bookorb);
  list.put(WeaponType.ORB_2H,bookorb);
  float polearm[]={1400f,2800f};
  list.put(WeaponType.POLEARM_2H,polearm);
  list.put(WeaponType.TOOLPICK_2H,polearm);
  list.put(WeaponType.TOOLROD_2H,polearm);
  list.put(WeaponType.CANNON_2H,polearm);
  list.put(WeaponType.GUN_2H,polearm);
  list.put(WeaponType.KEYBLADE_2H,polearm);
  list.put(WeaponType.KEYHAMMER_2H,polearm);
  float staff[]={1000f,2000f};
  list.put(WeaponType.STAFF_2H,staff);
  list.put(WeaponType.HARP_2H,staff);
  float swordbow[]={1200f,2400f};
  list.put(WeaponType.SWORD_2H,swordbow);
  list.put(WeaponType.BOW,swordbow);
  float speed=0;
  if (method.equalsIgnoreCase("base")) {
    speed=list.get(weapon.getMainHand())[1];
    if (weapon.getOffHand() != null) {
      speed+=(list.get(weapon.getOffHand())[1] * 0.25);
    }
  }
 else   if (method.equalsIgnoreCase("cap")) {
    speed=list.get(weapon.getMainHand())[0];
    if (weapon.getOffHand() != null) {
      speed+=(list.get(weapon.getOffHand())[0] * 0.25);
    }
  }
 else {
    try {
      speed=Float.parseFloat(method);
    }
 catch (    Exception e) {
    }
  }
  finalTime=Math.round((float)time / (float)attackSpeed * speed);
  return finalTime;
}

private int recalculate ( String method , WeaponTypeWrapper weapon , int attackSpeed , int time ) { int finalTime = 0 ; TreeMap < WeaponType , float [ ] > list = new TreeMap < WeaponType , float [ ] > ( ) ; float dagger [ ] = { 600f , 1200f } ; list . put ( WeaponType . DAGGER_1H , dagger ) ; float mace [ ] = { 750f , 1500f } ; list . put ( WeaponType . MACE_1H , mace ) ; list . put ( WeaponType . GUN_1H , mace ) ; list . put ( WeaponType . TOOLHOE_1H , mace ) ; float sword1h [ ] = { 700f , 1400f } ; list . put ( WeaponType . SWORD_1H , sword1h ) ; float bookorb [ ] = { 1100f , 2200f } ; list . put ( WeaponType . BOOK_2H , bookorb ) ; list . put ( WeaponType . ORB_2H , bookorb ) ; float polearm [ ] = { 1400f , 2800f } ; list . put ( WeaponType . POLEARM_2H , polearm ) ; list . put ( WeaponType . TOOLPICK_2H , polearm ) ; list . put ( WeaponType . TOOLROD_2H , polearm ) ; list . put ( WeaponType . CANNON_2H , polearm ) ; list . put ( WeaponType . GUN_2H , polearm ) ; list . put ( WeaponType . KEYBLADE_2H , polearm ) ; list . put ( WeaponType . KEYHAMMER_2H , polearm ) ; float staff [ ] = { 1000f , 2000f } ; list . put ( WeaponType . STAFF_2H , staff ) ; list . put ( WeaponType . HARP_2H , staff ) ; float swordbow [ ] = { 1200f , 2400f } ; list . put ( WeaponType . SWORD_2H , swordbow ) ; list . put ( WeaponType . BOW , swordbow ) ; float speed = 0 ; if ( method . equalsIgnoreCase ( "base" ) ) { speed = list . get ( weapon . getMainHand ( ) ) [ 1 ] ; if ( weapon . getOffHand ( ) != null ) { speed += ( list . get ( weapon . getOffHand ( ) ) [ 1 ] * 0.25 ) ; } } else if ( method . equalsIgnoreCase ( "cap" ) ) { speed = list . get ( weapon . getMainHand ( ) ) [ 0 ] ; if ( weapon . getOffHand ( ) != null ) { speed += ( list . get ( weapon . getOffHand ( ) ) [ 0 ] * 0.25 ) ; } } else { try { speed = Float . parseFloat ( method ) ; } catch ( Exception e ) { } } finalTime = Math . round ( ( float ) time / ( float ) attackSpeed * speed ) ; return finalTime ; }
method used to recalculate time to base , cap or given attackspeed
