private boolean moveTypeUp(List<Entity> copy,int index,int indexOfSameType,boolean forceIt){
  if (!forceIt) {
    for (int i=index - 1; i > indexOfSameType; i--) {
      if (dependsOn(copy,index,i)) {
        return false;
      }
    }
  }
  LOG.debug("Moving " + copy.get(index) + " at "+ index+ " up to "+ copy.get(indexOfSameType)+ " at "+ (indexOfSameType + 1));
  copy.add(indexOfSameType + 1,copy.remove(index));
  return true;
}

private boolean moveTypeUp ( List < Entity > copy , int index , int indexOfSameType , boolean forceIt ) { if ( ! forceIt ) { for ( int i = index - 1 ; i > indexOfSameType ; i -- ) { if ( dependsOn ( copy , index , i ) ) { return false ; } } } LOG . debug ( "Moving " + copy . get ( index ) + " at " + index + " up to " + copy . get ( indexOfSameType ) + " at " + ( indexOfSameType + 1 ) ) ; copy . add ( indexOfSameType + 1 , copy . remove ( index ) ) ; return true ; }
will move the entity at index to beside indexofsametype as long as dependency analysis allows .
