Examples of Point2I


Examples of rlforj.math.Point2I

  }
 
  public static void main(String[] args)
  {
    TestBoard1 b=new TestBoard1(false);
    b.exception.add(new Point2I(11, 11));
    b.exception.add(new Point2I(7, 8));
    MultiRaysCaster m=new MultiRaysCaster();
    m.visitFieldOfView(b, 10, 10, 10);
    System.out.println(b.obsNotVisited);
    b.mark(10, 10, '@');
    b.print(0, 20, 0, 20);
View Full Code Here

Examples of rlforj.math.Point2I

    @Override
    public void visit(int x, int y)
    {
      super.visit(x, y);
      System.out.println("Visiting "+x+" "+y);
      obsNotVisited.remove(new Point2I(x, y));
    }
View Full Code Here

Examples of rlforj.math.Point2I

   
    @Override
    public boolean isObstacle(int x, int y)
    {
      System.out.println("isObs "+x+" "+y);
      obsNotVisited.add(new Point2I(x, y));
      return super.isObstacle(x, y);
    }
View Full Code Here

Examples of rlforj.math.Point2I

  {
    if(path.size()<1) return;
   
    int lastx=path.get(0).x, lasty=path.get(0).y;
    for(int i=1; i<path.size(); i++) {
      Point2I p=path.get(i);
      int x=p.x, y=p.y;
      if(x!=lastx) {
        if(y!=lasty) {
          b.mark(x, y, ((x-lastx)*(y-lasty)>0)?'\\':'/');
        } else
View Full Code Here

Examples of rlforj.math.Point2I

    marks.clear();
    visited = new boolean[w][h];
  }

  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

  {
    visited[x][y]=true;
  }
 
  public void print(int ox, int oy) {
    Point2I p=new Point2I(0, 0);
    for(int j=0; j<h; j++) {
      for(int i=0; i<w; i++) {
        p.x=i; p.y=j;
        Character c=marks.get(p);
        if(c!=null) System.out.print(c);
View Full Code Here

Examples of rlforj.math.Point2I

                {
                    assertFalse("A point on A* path was an obstacle", m.isObstacle(step.x, step.y));
                }
               
                // Check continuity
                Point2I lastStep = null;
                for (Point2I step: path)
                {
                    if (lastStep == null)
                    {
                        lastStep = step;
View Full Code Here

Examples of rlforj.math.Point2I

                    board[i][j] = EMPTY;
            }
        }
       
        ArrayList<Point2I> l = new ArrayList<Point2I>(width * height);
        l.add(new Point2I(x1, y1));
        while(!l.isEmpty())
        {
            Point2I p1 = l.remove(l.size() - 1);
            for(Directions d: Directions.N8)
            {
                Point2I p2 = new Point2I(p1.x+d.dx(), p1.y+d.dy());
                if (!mb.contains(p2.x, p2.y) || board[p2.x][p2.y] != EMPTY)
                    continue;
               
                board[p2.x][p2.y] = COLOR;
                l.add(p2);
View Full Code Here

Examples of transientlibs.rlforj.math.Point2I

       
        Iterator<Point2I> it = path.iterator();
        it.next();
       
        while (it.hasNext()) {
            Point2I coords = it.next();
            onX = fromScreenX + ((coords.x - fromCoords.getIntX())*Terrain.tileWidth);
            onY = fromScreenY + ((coords.y - fromCoords.getIntY())*Terrain.tileHeight);
            if (Detonator.INSTANCE.tileMovementCalculator.isShootingObstacle (coords.x, coords.y)) {
            redTile.draw(onX, onY);
            } else{
View Full Code Here

Examples of transientlibs.rlforj.math.Point2I

        clearSight();
        //visited = new boolean[w][h];
    }

    public void mark(int x, int y, char c) {
        marks.put(new Point2I(x, y), c);
    }
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.