public double canUse(GadgetType gadget){
  Object count=gadgetCooldowns.get(gadget);
  if (count == null || System.currentTimeMillis() > (long)count) {
    return -1;
  }
  double valueMillis=(long)count - System.currentTimeMillis();
  return valueMillis / 1000d;
}

public double canUse ( GadgetType gadget ) { Object count = gadgetCooldowns . get ( gadget ) ; if ( count == null || System . currentTimeMillis ( ) > ( long ) count ) { return - 1 ; } double valueMillis = ( long ) count - System . currentTimeMillis ( ) ; return valueMillis / 1000d ; }
checks if a player can use a given gadget type .
