Entity entity = game.getEntity(entityId); for (Enumeration i = game.getEntities(coords); i.hasMoreElements();) { final Entity inHex = (Entity)i.nextElement(); if ((!isMech || inHex instanceof Mech) && inHex.isEnemyOf(entity) && !inHex.isMakingDfa()) { return true; } } return false;
return isEnemyIn(game, entityId, coords, isMech, game.getEntity(entityId).getElevation());
    public static boolean isEnemyIn(IGame game, int entityId, Coords coords, boolean isMech) {        Entity entity = game.getEntity(entityId);        for (Enumeration i = game.getEntities(coords); i.hasMoreElements();) {            final Entity inHex = (Entity)i.nextElement();            if ((!isMech || inHex instanceof Mech) && inHex.isEnemyOf(entity) && !inHex.isMakingDfa()) {                return true;            }        }        return false;    }