Examples of Point2I


Examples of rlforj.math.Point2I

    mask.fovType = FovType.SQUARE;
    mask.distPlusOneSq = 0;
    mask.board = fb;

    fovStateT state = new fovStateT();
    state.source = new Point2I(startX, startY);
    state.mask = mask;
    state.board = fb;
    state.isLos = true;
    state.quadrant = new Point2I(dx < 0 ? -1 : 1, dy < 0 ? -1 : 1);
    state.quadrantIndex = 0;

    LinkedList<bumpT> steepBumps = new LinkedList<bumpT>();
    LinkedList<bumpT> shallowBumps = new LinkedList<bumpT>();
    // activeFields is sorted from shallow-to-steep.
    LinkedList<fieldT> activeFields = new LinkedList<fieldT>();
    activeFields.addLast(new fieldT());
    activeFields.getLast().shallow.near = new Point2I(0, 1);
    activeFields.getLast().shallow.far = new Point2I(adx + 1, 0);
    activeFields.getLast().steep.near = new Point2I(1, 0);
    activeFields.getLast().steep.far = new Point2I(0, ady + 1);

    Point2I dest = new Point2I(0, 0);

    Line2I stopLine = new Line2I(new Point2I(0, 1), new Point2I(adx, ady + 1)), startLine = new Line2I(
        new Point2I(1, 0), new Point2I(adx + 1, ady));

    // Visit the source square exactly once (in quadrant 1).
    actIsBlocked(state, dest);

    CLikeIterator<fieldT> currentField = new CLikeIterator<fieldT>(
        activeFields.listIterator());
    int maxI = adx + ady;
    // For each square outline
    int lastStartJ = -1;
    Point2I topLeft = new Point2I(0, 0), bottomRight = new Point2I(0, 0);
    for (int i = 1; i <= maxI && !activeFields.isEmpty(); ++i)
    {
      // System.out.println("i "+i);
      int startJ = max(0, i - adx);
      startJ = max(startJ, lastStartJ - 1);
View Full Code Here

Examples of rlforj.math.Point2I

  class fieldT
  {
    public fieldT(fieldT f)
    {
      steep = new Line2I(new Point2I(f.steep.near.x, f.steep.near.y),
          new Point2I(f.steep.far.x, f.steep.far.y));
      shallow = new Line2I(
          new Point2I(f.shallow.near.x, f.shallow.near.y),
          new Point2I(f.shallow.far.x, f.shallow.far.y));
      steepBump = f.steepBump;
      shallowBump = f.shallowBump;
    }
View Full Code Here

Examples of rlforj.math.Point2I

    {
      int dx = x - sx;
      dx = dx > 0 ? dx : -dx;
      int dy = y - sy;
      dy = dy > 0 ? dy : -dy;
      visitedNotObs.add(new Point2I(dx, dy));
    }
    //DEBUG
//    b.visit(x, y);
  }
View Full Code Here

Examples of rlforj.math.Point2I

//    if(finishAngle>360) finishAngle%=360;
//    System.out.println(startAngle+" "+finishAngle);
   
    TestBoard b=new TestBoard(false);
   
    b.exception.add(new Point2I(15, 15));
    b.exception.add(new Point2I(15, 16));
    b.exception.add(new Point2I(16, 15));
   
    IConeFovAlgorithm a= new ConePrecisePremisive();
   
    a.visitConeFieldOfView(b, 10, 10, 10, startAngle, finishAngle);
   
View Full Code Here

Examples of rlforj.math.Point2I

  {
    this.def = defaultObscured;
  }

  public void mark(int x, int y, char c) {
    marks.put(new Point2I(x, y), c);
  }
View Full Code Here

Examples of rlforj.math.Point2I

    return true;
  }

  public boolean isObstacle(int x, int y)
  {
    Point2I p = new Point2I(x, y);
    if (!visited.contains(p))
      chkb4visit.add(p);
    return def ^ exception.contains(new Point2I(x, y));
  }
View Full Code Here

Examples of rlforj.math.Point2I

    return def ^ exception.contains(new Point2I(x, y));
  }

  public void visit(int x, int y)
  {
    Point2I p = new Point2I(x, y);
    if (visited.contains(p))
      visiterr.add(p);
    visited.add(new Point2I(x, y));
  }
View Full Code Here

Examples of rlforj.math.Point2I

  {
    for (int y = fromy; y <= toy; y++)
    {
      for (int x = fromx; x <= tox; x++)
      {
        Point2I point = new Point2I(x, y);
        Character c=marks.get(point);
        if(c==null) {
          if (isObstacle(x, y))
            c=(visited.contains(point) ? '#'
                : 'x');
View Full Code Here

Examples of rlforj.math.Point2I

   
    a.visitFieldOfView(b, 10, 10, 5);
//    b.print(5, 15, 5, 15);
//    System.out.println();
   
    assertTrue(b.visited.contains(new Point2I(11, 11)));
    assertTrue(b.visited.contains(new Point2I(10, 11)));
    assertTrue(b.visited.contains(new Point2I(11, 10)));
    assertTrue(b.visited.contains(new Point2I(10, 15)));
    assertTrue(b.visited.contains(new Point2I(15, 10)));
  }
View Full Code Here

Examples of rlforj.math.Point2I

   
    a.visitFieldOfView(b, 10, 10, 5);
//    b.print(5, 15, 5, 15);
//    System.out.println();
   
    assertTrue(b.visited.contains(new Point2I(11, 11)));
    assertTrue(b.visited.contains(new Point2I(10, 11)));
    assertTrue(b.visited.contains(new Point2I(11, 10)));
    assertFalse(b.visited.contains(new Point2I(10, 15)));
    assertFalse(b.visited.contains(new Point2I(15, 10)));
  }
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.