Class PathObstacle

    • Constructor Summary

      Constructors 
      Constructor Description
      PathObstacle​(java.lang.String name, java.lang.String action, Tile startTile, Tile endTile, Tile obstacleTile)
      Creates a new PathObstacle
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract PathObstacle duplicate​(Tile obsTile)
      Duplicates the current PathObstacle and sets the obstacle's tile to given tile
      boolean equals​(java.lang.Object obj)  
      boolean exists()
      Checks whether the obstacles name, action, end tile, start tile, existing tile, and object itself exist
      java.lang.String getAction()
      Gets action.
      Tile getEndTile()
      Gets the ending tile of the obstacle
      java.lang.String getName()
      Gets name.
      GameObject getObstacle()
      Get obstacle.
      Tile getObstacleTile()
      Gets the Tile the obstacle is on
      int getPriority()
      Gets the priority of the obstacle, a higher integer means a higher priority, the highest priority obstacle found on a tile will be executed.
      java.util.Optional<Tile> getStartTile()
      Gets an Optional based Tile of the start tile for the obstacle
      int hashCode()  
      abstract boolean isCompleted()
      Checks if the obstacle has been completed
      boolean isValid()
      Checks to see if the obstacle exists
      void setAction​(java.lang.String action)
      Sets action.
      void setEndTile​(Tile endTile)
      Sets the ending tile of the obstacle
      void setName​(java.lang.String name)
      Sets name.
      void setObstacleTile​(Tile obstacleTile)
      Sets the Tile the obstacle is on
      void setStartTile​(Tile start)
      Sets the start tile of the obstacle
      boolean traverse()
      Traverses the obstacle **NOTE** this is not abstract to preserve currently compilation of existing overrides At some point when deprecated methods start to be removed, this *will* become abstract
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PathObstacle

        public PathObstacle​(java.lang.String name,
                            java.lang.String action,
                            Tile startTile,
                            Tile endTile,
                            Tile obstacleTile)
        Creates a new PathObstacle
        Parameters:
        name - Name of obstacle
        action - Action of obstacle
        startTile - Tile to be on/near to start of obstacle
        endTile - Tile to be on/near/be able to reach after using the obstacle
        obstacleTile - Tile of the obstacle
    • Method Detail

      • duplicate

        public abstract PathObstacle duplicate​(Tile obsTile)
        Duplicates the current PathObstacle and sets the obstacle's tile to given tile
        Parameters:
        obsTile - Obstacle's tile
        Returns:
        duplicated PathObstacle
      • getName

        public java.lang.String getName()
        Gets name.
        Returns:
        the name
      • setName

        public void setName​(java.lang.String name)
        Sets name.
        Parameters:
        name - the name
      • getAction

        public java.lang.String getAction()
        Gets action.
        Returns:
        the action
      • setAction

        public void setAction​(java.lang.String action)
        Sets action.
        Parameters:
        action - the action
      • getEndTile

        public Tile getEndTile()
        Gets the ending tile of the obstacle
        Returns:
        Optional based Tile of the ending tile
      • setEndTile

        public void setEndTile​(Tile endTile)
        Sets the ending tile of the obstacle
        Parameters:
        endTile - Tile you expect to be after you solve the obstacle
      • getObstacleTile

        public Tile getObstacleTile()
        Gets the Tile the obstacle is on
        Returns:
        Optional based Tile of the obstacle's Tile
      • setObstacleTile

        public void setObstacleTile​(Tile obstacleTile)
        Sets the Tile the obstacle is on
        Parameters:
        obstacleTile - Tile the obstacle is on
      • getStartTile

        public java.util.Optional<Tile> getStartTile()
        Gets an Optional based Tile of the start tile for the obstacle
        Returns:
        Optional based Tile of the start tile of the obstacle
      • setStartTile

        public void setStartTile​(Tile start)
        Sets the start tile of the obstacle
        Parameters:
        start - Tile expected to be at before solving the obstacle
      • getObstacle

        public GameObject getObstacle()
        Get obstacle.
        Returns:
        the obstacle if it exists or null
      • exists

        public boolean exists()
        Checks whether the obstacles name, action, end tile, start tile, existing tile, and object itself exist
        Returns:
        true if all exist, else false
      • isCompleted

        public abstract boolean isCompleted()
        Checks if the obstacle has been completed
        Returns:
      • isValid

        public boolean isValid()
        Checks to see if the obstacle exists
        Returns:
      • traverse

        public boolean traverse()
        Traverses the obstacle **NOTE** this is not abstract to preserve currently compilation of existing overrides At some point when deprecated methods start to be removed, this *will* become abstract
        Returns:
        true if successfully traversed
      • getPriority

        public int getPriority()
        Gets the priority of the obstacle, a higher integer means a higher priority, the highest priority obstacle found on a tile will be executed.
        Returns:
        integer based priority, higher integer is higher priority, default is 1
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object