Package net.sf.l2j.gameserver.pathfinding

Examples of net.sf.l2j.gameserver.pathfinding.Node


    while (pos != 1)
    {
      int p2 = pos/2;
      if (_list[pos].getCost() <= _list[p2].getCost())
      {
        Node temp = _list[p2];
        _list[p2] = _list[pos];
        _list[pos] = temp;
            pos = p2;
      }
      else
View Full Code Here


        break;
    }
  }
  public Node removeFirst()
  {
    Node first = _list[1];
    _list[1] = _list[_size];
    _list[_size] = null;
    _size--;
    int pos = 1;
    int cpos;
    int dblcpos;
    Node temp;
    while(true)
    {
      cpos = pos;
      dblcpos = cpos*2;
      if ((dblcpos+1) <= _size)
View Full Code Here

   * @see net.sf.l2j.gameserver.pathfinding.PathFinding#findPath(int, int, short, int, int, short)
   */
  @Override
  public List<AbstractNodeLoc> findPath(int gx, int gy, short z, int gtx, int gty, short tz)
  {
    Node start = readNode(gx,gy,z);
    Node end = readNode(gtx,gty,tz);
    if (start == null || end == null)
      return null;
    if (start == end)
      return null;

View Full Code Here

  {
    short regoffset = getRegionOffset(getRegionX(node_x),getRegionY(node_y));
    ByteBuffer pn = _pathNodes.get(regoffset);

    List<Node> Neighbors = new FastList<Node>(8);
    Node newNode;
    short new_node_x, new_node_y;

    //Region for sure will change, we must read from correct file
    byte neighbor = pn.get(idx); //N
    idx++;
View Full Code Here

    {
      _log.warning("SmthWrong!");
    }
    short node_z = pn.getShort(idx);
    idx += 2;
    return new Node(new GeoNodeLoc(node_x,node_y,node_z), idx);
  }
View Full Code Here

        idx2 = idx+2;
      }
      idx += 10; //short + 8 byte
      nodes--;
    }
    return new Node(new GeoNodeLoc(node_x,node_y,last_z), idx2);
  }
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.pathfinding.Node

Copyright © 2018 www.massapicom. 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.