Package role

Class ScreenBoundary

All Implemented Interfaces:
Configuration, Cloneable, Comparable<EntityModel>

public class ScreenBoundary extends BarrierModel
This class represents a screen boundary. It extends the BarrierModel. The screen boundary can take any of the directions specified in Configuration.Direction.
Author:
Krish Pillai
  • Constructor Details

    • ScreenBoundary

      public ScreenBoundary(Line line, Configuration.Direction edge)
      Constructor for a screen boundary.
      Parameters:
      line - the line defining this barrier
      edge - the direction of the barrier
  • Method Details

    • getEdge

      public Configuration.Direction getEdge()
      Getter for the direction this barrier takes.
      Returns:
      the direction
    • toString

      public String toString()
      Description copied from class: EntityModel
      String representation of the entity showing unique ID, location and collision bounds.
      Overrides:
      toString in class BarrierModel
      Returns:
      a string representation of the entity
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class EntityModel
    • isOutOfBounds

      public boolean isOutOfBounds(EntityModel entity)
      Checks if entity is out of bounds for this screen boundary
      Parameters:
      entity -
      Returns:
      true or false