Examples of Vec2i


Examples of com.puzzlebazar.shared.util.Vec2i

      boolean valid,
      boolean visited,
      boolean[][] validCells,
      boolean[][] visitedCells) {

    Vec2i loc = new Vec2i();
    for (int i = 0; i < validCells.length; ++i) {
      loc.x = i;
      for (int j = 0; j < validCells[i].length; ++j) {
        loc.y = j;
        if ((validCells[i][j] ^ !valid) && (visitedCells[i][j] ^ !visited)) {
View Full Code Here

Examples of com.puzzlebazar.shared.util.Vec2i

   * @param thickness The desired thickness of the inner edges.
   * @param styleNames A list of string containing all the desired style names. (The default edge style is added automatically.)
   * @return A list of all newly created widgets.
   */
  public List<Widget> createInnerEdges(int thickness, String... styleNames) {
    Vec2i loc = new Vec2i();
    List<Widget> result = new ArrayList<Widget>();
    for (int y = 0; y < height; ++y) {
      loc.y = y;
      for (int x = 0; x < width; ++x) {
        loc.x = x;
View Full Code Here

Examples of com.puzzlebazar.shared.util.Vec2i

   * @param thickness The desired thickness of the inner edges.
   * @param styleNames A list of string containing all the desired style names. (The default edge style is added automatically.)
   * @return A list of all newly created widgets.
   */
  public List<Widget> createOuterEdges(int thickness, String... styleNames) {
    Vec2i loc = new Vec2i();
    List<Widget> result = new ArrayList<Widget>();
    for (int y = 0; y <= height; y += height) {
      loc.y = y;
      for (int x = 0; x < width; ++x) {
        loc.x = x;
View Full Code Here

Examples of com.puzzlebazar.shared.util.Vec2i

    if (edgeHitInfo != null) {
      fireEvent(new EdgeMouseDownEvent(edgeHitInfo.isVertical(), edgeHitInfo.getEdge()));
      return;
    }

    Vec2i cell = cellHit(x, y);
    if (cell != null) {
      fireEvent(new CellMouseDownEvent(cell));
    }
  }
View Full Code Here

Examples of com.puzzlebazar.shared.util.Vec2i

    if (edgeHitInfo != null) {
      fireEvent(new EdgeMouseUpEvent(edgeHitInfo.isVertical(), edgeHitInfo.getEdge()));
      return;
    }

    Vec2i cell = cellHit(x, y);
    if (cell != null) {
      fireEvent(new CellMouseUpEvent(cell));
    }
  }
View Full Code Here

Examples of com.puzzlebazar.shared.util.Vec2i

      }
      fireEvent(new EdgeMouseMoveEvent(edgeHitInfo.isVertical(), edgeHitInfo.getEdge()));
      return;
    }

    Vec2i cell = cellHit(x, y);
    if (cell != null) {
      if (current != OVER_CELL ||
          !currentLoc.equals(cell)) {
        fireOutEvent();
        current = OVER_CELL;
View Full Code Here

Examples of com.puzzlebazar.shared.util.Vec2i

   */
  private Vec2i cellHit(int x, int y) {
    if (squareGridConverter == null || squareGridValidator == null) {
      return null;
    }
    Vec2i cell = squareGridConverter.pixelToCell(x, y);
    if (squareGridValidator.isValidCell(cell)) {
      return cell;
    }
    return null;
  }
View Full Code Here

Examples of org.matheusdev.util.vecs.Vec2i

    int beginx = ((int) rect.x) / width;
    int beginy = ((int) rect.y) / height;
    int endx = ((int) (rect.x + rect.w)) / width;
    int endy = ((int) (rect.y + rect.h)) / height;

    Vec2i pos = new Vec2i(0, 0);
    for (int y = beginy; y <= endy; y++) {
      for (int x = beginx; x <= endx; x++) {
        pos.set(x, y);

        ArrayList<E> mapList = map.get(pos);

        if (mapList == null) {
          ArrayList<E> list = new ArrayList<E>();
          list.add(e);
          map.put(new Vec2i(x, y), list);
        } else {
          mapList.add(e);
        }
      }
    }
View Full Code Here

Examples of org.matheusdev.util.vecs.Vec2i

    int endx = ((int) (region.x + region.w)) / width;
    int endy = ((int) (region.y + region.h)) / height;

    for (int y = beginy; y <= endy; y++) {
      for (int x = beginx; x <= endx; x++) {
        Vec2i pos = Vec2i.get(x, y);
        ArrayList<E> elements = map.get(pos);

        if (elements != null) {
          for (int i = 0; i < elements.size(); i++) {
            boolean continueSearching = callback.handleElement(x, y, elements.get(i));
View Full Code Here

Examples of org.matheusdev.util.vecs.Vec2i

    int endx = ((int) (region.x + region.w)) / width;
    int endy = ((int) (region.y + region.h)) / height;

    for (int y = beginy; y <= endy; y++) {
      for (int x = beginx; x <= endx; x++) {
        Vec2i pos = Vec2i.get(x, y);
        ArrayList<E> elements = map.get(pos);

        if (elements != null) {
          queryList.addAll(elements);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.