Class PathNode

  • All Implemented Interfaces:
    java.lang.Comparable<PathNode>

    public class PathNode
    extends java.lang.Object
    implements java.lang.Comparable<PathNode>
    A path node in the current region.
    • Constructor Summary

      Constructors 
      Constructor Description
      PathNode​(int x, int y, int z)
      Create a new node
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      int compareTo​(PathNode other)
      float getCost()
      Gets the movement cost of this node.
      int getDepth()
      Gets the depth of search used for this node.
      float getHeuristic()
      Deprecated.
      GameObject getObject()  
      PathNode getOwner()
      Gets owner of this node.
      int getX()
      Gets the X coordinate for this node.
      int getY()
      Gets the Y coordinate for this node.
      int getZ()  
      void setCost​(float cost)
      Sets the movement cost of this node.
      void setDepth​(int depth)
      Sets the depth of search used for this node.
      void setHeuristic​(float heuristic)
      Deprecated.
      int setOwner​(PathNode owner)
      Set the owner of this node.
      void setX​(int x)
      Sets the X coordinate for this node.
      void setY​(int y)
      Sets the Y coordinate for this node.
      void setZ​(int z)  
      java.lang.String toString()  
      Tile toTile()
      Creates a global tile from current client global coordinates from node coordinates
      Tile toTile​(int baseX, int baseY)
      Creates a global tile from node coordinates.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PathNode

        public PathNode​(int x,
                        int y,
                        int z)
        Create a new node
        Parameters:
        x - The x coordinate of the node
        y - The y coordinate of the node
        z - The z coordinate of the node
    • Method Detail

      • compareTo

        public int compareTo​(PathNode other)
        Specified by:
        compareTo in interface java.lang.Comparable<PathNode>
      • getX

        public int getX()
        Gets the X coordinate for this node.
        Returns:
        the X coordinate for this node as a int.
      • setX

        public void setX​(int x)
        Sets the X coordinate for this node.
        Parameters:
        x - the X coordinate you wish to set.
      • getY

        public int getY()
        Gets the Y coordinate for this node.
        Returns:
        the Y coordinate for this node as a int.
      • setY

        public void setY​(int y)
        Sets the Y coordinate for this node.
        Parameters:
        y - the Y coordinate you wish to set.
      • getZ

        public int getZ()
      • setZ

        public void setZ​(int z)
      • getDepth

        public int getDepth()
        Gets the depth of search used for this node.
        Returns:
        the depth of search used for this node as a int.
      • setDepth

        public void setDepth​(int depth)
        Sets the depth of search used for this node.
        Parameters:
        depth - the depth of search you wish to set.
      • getCost

        public float getCost()
        Gets the movement cost of this node.
        Returns:
        the movement cost of this node as a float.
      • setCost

        public void setCost​(float cost)
        Sets the movement cost of this node.
        Parameters:
        cost - the movement cost you wish to set.
      • getHeuristic

        @Deprecated
        public float getHeuristic()
        Deprecated.
        Gets heuristic value for this node.
        Returns:
        the heuristic value of this node as a float.
      • setHeuristic

        @Deprecated
        public void setHeuristic​(float heuristic)
        Deprecated.
        Sets heuristic value for this node.
        Parameters:
        heuristic - the heuristic value you wish to set.
      • getOwner

        public PathNode getOwner()
        Gets owner of this node.
        Returns:
        the owner of this node as a PathNode.
      • setOwner

        public int setOwner​(PathNode owner)
        Set the owner of this node.
        Parameters:
        owner - The owner of this node.
        Returns:
        The depth of search.
      • toTile

        public Tile toTile()
        Creates a global tile from current client global coordinates from node coordinates
        Returns:
        a global tile created from node coordinates
      • toTile

        public Tile toTile​(int baseX,
                           int baseY)
        Creates a global tile from node coordinates.
        Parameters:
        baseX - The base X coordinates you would like to create tile from.
        baseY - The base Y coordinates you would like to create tile from.
        Returns:
        a global tile created from the node coordinates.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object