public static boolean isEnemyIn(IGame game,Entity entity,Coords coords,boolean onlyMechs,boolean ignoreInfantry,int enLowEl){
  int enHighEl=enLowEl + entity.getHeight();
  for (  Entity inHex : game.getEntitiesVector(coords)) {
    int inHexEnLowEl=inHex.getElevation();
    int inHexEnHighEl=inHexEnLowEl + inHex.getHeight();
    if ((!onlyMechs || (inHex instanceof Mech)) && !(ignoreInfantry && (inHex instanceof Infantry)) && inHex.isEnemyOf(entity)&& !inHex.isMakingDfa()&& (enLowEl <= inHexEnHighEl)&& (enHighEl >= inHexEnLowEl)) {
      return true;
    }
  }
  return false;
}

public static boolean isEnemyIn ( IGame game , Entity entity , Coords coords , boolean onlyMechs , boolean ignoreInfantry , int enLowEl ) { int enHighEl = enLowEl + entity . getHeight ( ) ; for ( Entity inHex : game . getEntitiesVector ( coords ) ) { int inHexEnLowEl = inHex . getElevation ( ) ; int inHexEnHighEl = inHexEnLowEl + inHex . getHeight ( ) ; if ( ( ! onlyMechs || ( inHex instanceof Mech ) ) && ! ( ignoreInfantry && ( inHex instanceof Infantry ) ) && inHex . isEnemyOf ( entity ) && ! inHex . isMakingDfa ( ) && ( enLowEl <= inHexEnHighEl ) && ( enHighEl >= inHexEnLowEl ) ) { return true ; } } return false ; }
returns true if there is any unit that is an enemy of the specified unit in the specified hex . this is only called for stacking purposes , and so does not return true if the enemy unit is currenly making a dfa .
