示例#1
0
  /**
   * Returns every tile that is visible at a given location, ordered such that the tile with highest
   * priority (the tile returned by look) is first, and the lowest priority is last. This last tile
   * will be the face of the actual tile itself. Note that any actor which has a null face will not
   * be included.
   *
   * @param x the x value of the location being queried
   * @param y the y value of the location being queried
   * @return every tile that is visible at a given location
   */
  public List<ColoredChar> lookAll(int x, int y) {
    Guard.argumentsInsideBounds(x, y, width, height);

    List<ColoredChar> look = new ArrayList<ColoredChar>();

    for (Class<? extends Actor> cls : drawOrder)
      for (Actor actor : getActorsAt(cls, x, y)) {
        ColoredChar face = actor.face();
        if (face != null) look.add(actor.face());
      }

    look.add(tileAt(x, y));

    return look;
  }