public class Force
extends java.lang.Object
Constructor and Description |
---|
Force(java.awt.geom.Point2D location,
float strength,
float size)
Instantiates a new force.
|
Modifier and Type | Method and Description |
---|---|
boolean |
cancelOnCollision()
Cancel on collision.
|
boolean |
cancelOnReached() |
void |
end() |
java.lang.String |
getIdentifier() |
java.awt.geom.Point2D |
getLocation()
Gets the location.
|
float |
getStrength()
Gets the strength in pixels per second.
|
boolean |
hasEnded()
Checks for ended.
|
boolean |
hasReached(ICollisionEntity entity) |
void |
setCancelOnCollision(boolean cancelOnCollision) |
void |
setCancelOnReached(boolean cancelOnReached) |
void |
setIdentifier(java.lang.String identifier) |
void |
setLocation(java.awt.geom.Point2D location) |
void |
setStrength(float strength) |
java.lang.String |
toString() |
public Force(java.awt.geom.Point2D location, float strength, float size)
location
- The location where the force is originating fromstrength
- The strength/intensity of this force instancesize
- The size of this force (used to determine if/when an entity has
reached the force)public boolean cancelOnCollision()
public boolean cancelOnReached()
public void end()
public java.awt.geom.Point2D getLocation()
public float getStrength()
public java.lang.String getIdentifier()
public boolean hasEnded()
public boolean hasReached(ICollisionEntity entity)
public void setCancelOnCollision(boolean cancelOnCollision)
public void setCancelOnReached(boolean cancelOnReached)
public void setLocation(java.awt.geom.Point2D location)
public void setStrength(float strength)
public void setIdentifier(java.lang.String identifier)
public java.lang.String toString()
toString
in class java.lang.Object