public static boolean isInSameBuilding(IGame game, Entity attacker, Targetable target) { if (!(target instanceof Entity)) { return false;
public static boolean isInSameBuilding(IGame game, Entity attacker, Targetable target) { if (!(target instanceof Entity)) { return false; } Entity targetEntity = (Entity) target; if (!isInBuilding(game, attacker) || !isInBuilding(game, targetEntity)) { return false; }  Building attkBldg = game.getBoard().getBuildingAt( attacker.getPosition()); Building targBldg = game.getBoard().getBuildingAt(target.getPosition());  return attkBldg.equals(targBldg);
  public static boolean isInSameBuilding(IGame game, Entity attacker, Targetable target) {    if (!(target instanceof Entity)) {      return false;    }    Entity targetEntity = (Entity)target;    if (!isInBuilding(game, attacker) || !isInBuilding(game, targetEntity)) {      return false;    }    Building attkBldg = game.getBoard().getBuildingAt(attacker.getPosition());    Building targBldg = game.getBoard().getBuildingAt(target.getPosition());    return attkBldg.equals(targBldg);  }