Class Boundary

  • Direct Known Subclasses:
    EntityBoundary, MapSectorChangeBoundary

    public abstract class Boundary
    extends java.lang.Object
    An imaginary boundary, or border, with a width, height and coordinates
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int bottom
      Bottom side of the boundary, which is the y-coordinate + height
      org.newdawn.slick.Color drawColor
      The current color that is being used while rendering
      int height
      The boundary's height (includes padding)
      (package private) int horizontalOffset  
      boolean isCollided
      Whether or not the boundary is collided with another
      boolean isVisible  
      int left
      Left side of the boundary, which is the x-coordinate
      (package private) BoundaryOffset offset
      This boundary's offset (change in its coordinate)
      (package private) BoundaryPadding padding
      This boundary's padding (extra space added/subtracted from any or all of the four sides)
      int right
      Right side of the boundary, which is the x-coordinate + width
      int top
      Top side of the boundary, which is the y-coordinate
      (package private) int verticalOffset  
      int width
      The boundary's width (includes padding)
      int x
      Absolute x-coordinate
      int y
      Absolute y-coordinate
    • Constructor Summary

      Constructors 
      Constructor Description
      Boundary()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.Rectangle asRectangle()  
      void draw​(org.newdawn.slick.Graphics graphics)
      Renders the boundary
      void tick()
      Updates x, y, top, left, bottom and right
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • x

        public int x
        Absolute x-coordinate
      • y

        public int y
        Absolute y-coordinate
      • horizontalOffset

        int horizontalOffset
      • verticalOffset

        int verticalOffset
      • width

        public int width
        The boundary's width (includes padding)
      • height

        public int height
        The boundary's height (includes padding)
      • top

        public int top
        Top side of the boundary, which is the y-coordinate
      • right

        public int right
        Right side of the boundary, which is the x-coordinate + width
      • bottom

        public int bottom
        Bottom side of the boundary, which is the y-coordinate + height
      • left

        public int left
        Left side of the boundary, which is the x-coordinate
      • isCollided

        public boolean isCollided
        Whether or not the boundary is collided with another
      • isVisible

        public boolean isVisible
      • padding

        BoundaryPadding padding
        This boundary's padding (extra space added/subtracted from any or all of the four sides)
      • offset

        BoundaryOffset offset
        This boundary's offset (change in its coordinate)
      • drawColor

        public org.newdawn.slick.Color drawColor
        The current color that is being used while rendering
    • Constructor Detail

      • Boundary

        public Boundary()
    • Method Detail

      • draw

        public void draw​(org.newdawn.slick.Graphics graphics)
        Renders the boundary
        Parameters:
        graphics - Graphics object to use
      • asRectangle

        public java.awt.Rectangle asRectangle()
      • toString

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