Package role
Class ScreenBoundary
java.lang.Object
role.EntityModel
role.BarrierModel
role.ScreenBoundary
- All Implemented Interfaces:
Configuration,Cloneable,Comparable<EntityModel>
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
-
Nested Class Summary
Nested classes/interfaces inherited from interface common.Configuration
Configuration.Direction -
Field Summary
Fields inherited from interface common.Configuration
AUDIO_DIR, DEFAULT_FRAME_RATE, DRAWABLE_DIR, GAMELOGGER, setViewCallChain -
Constructor Summary
ConstructorsConstructorDescriptionScreenBoundary(Line line, Configuration.Direction edge) Constructor for a screen boundary. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetEdge()Getter for the direction this barrier takes.booleanisOutOfBounds(EntityModel entity) Checks if entity is out of bounds for this screen boundarytoString()String representation of the entity showing unique ID, location and collision bounds.Methods inherited from class role.BarrierModel
getAngleWithHorizontal, getBearingDegrees, getCollisionBounds, getCollisionRange, getLine, intersects, isActive, setActive, setCoefficientOfRestitution, setShowBounds, updateParametersMethods inherited from class role.EntityModel
clone, collidesWith, compareTo, dispose, getBearingRadians, getCoefficientOfRestitution, getHitboxHeight, getHitboxWidth, getID, getLayer, getMass, getName, getScaleX, getScaleY, getSpeed, getTimeToLive, getX, getXAcceleration, getXLocation, getXVelocity, getY, getYAcceleration, getYLocation, getYVelocity, hashCode, isAnimated, isDisposed, isGhost, isShowBounds, isVisible, isWrappedMode, poachState, resetCollisionBounds, resetEntityState, setAnimation, setCollisionBounds, setCollisionBounds, setGhost, setLayer, setLocation, setMass, setName, setScale, setScale, setTimeToLive, setVelocityDegrees, setVelocityRadians, setVisible, setWrappedMode, setXAcceleration, setXLocation, setXVelocity, setYAcceleration, setYLocation, setYVelocity
-
Constructor Details
-
ScreenBoundary
Constructor for a screen boundary.- Parameters:
line- the line defining this barrieredge- the direction of the barrier
-
-
Method Details
-
getEdge
Getter for the direction this barrier takes.- Returns:
- the direction
-
toString
Description copied from class:EntityModelString representation of the entity showing unique ID, location and collision bounds.- Overrides:
toStringin classBarrierModel- Returns:
- a string representation of the entity
-
equals
- Overrides:
equalsin classEntityModel
-
isOutOfBounds
Checks if entity is out of bounds for this screen boundary- Parameters:
entity-- Returns:
- true or false
-