Class BorderEntity

java.lang.Object
model.Entity
model.BorderEntity
All Implemented Interfaces:
EventListener, EntityEventListener

public class BorderEntity extends Entity
Entity of the game which is a Border. Borders will have IDs so that we can query which border we are working with. Extends Entity class with width, height and border id
  • Field Details

  • Constructor Details

    • BorderEntity

      public BorderEntity()
      ************************* constructors *********************************
    • BorderEntity

      public BorderEntity(String id)
    • BorderEntity

      public BorderEntity(String id, int width, int height)
    • BorderEntity

      public BorderEntity(int initialXPos, int initialYPos, int width, int height)
    • BorderEntity

      public BorderEntity(String id, int initialXPos, int initialYPos, int width, int height)
  • Method Details

    • setWidth

      public void setWidth(int width)
    • setHeight

      public void setHeight(int height)
    • setId

      public void setId(String id)
    • getWidth

      public int getWidth()
    • getHeight

      public int getHeight()
    • getId

      public String getId()
    • toString

      public String toString()
      Overrides:
      toString in class Entity
    • collisionArea

      protected Rectangle collisionArea()
      Define the area of the Entity to use for collision detection. This default uses the location and size of sprite.
      Overrides:
      collisionArea in class Entity
      Returns:
      the Rectangle this border covers
    • draw

      public void draw(Graphics g)
      Description copied from class: Entity
      Draw this entity to the graphics context provided
      Overrides:
      draw in class Entity
      Parameters:
      g - The graphics context on which to draw