Package | Description |
---|---|
cell2d | |
cell2d.space |
Modifier and Type | Method and Description |
---|---|
CellVector |
CellVector.relativeTo(SpaceObject object)
Flips this CellVector to reflect the flipped status of the specified
SpaceObject and rotates it to reflect the SpaceObject's angle of
rotation, as if those properties were formerly relative to the
SpaceObject.
|
Modifier and Type | Class and Description |
---|---|
class |
ThinkerObject<T extends CellGame>
A ThinkerObject is a SpaceObject that acts like a SpaceThinker, possessing
timers, various actions in response to events, and the capacity to act like a
ThinkerGroup, even though it is not technically one.
|
Modifier and Type | Method and Description |
---|---|
<O extends SpaceObject<T>> |
SpaceObject.boundingBoxesMeet(java.lang.Class<O> cls)
Returns all of the SpaceObjects of the specified class in this
SpaceObject's SpaceState whose overlap Hitboxes' rectangular bounding
boxes touch or intersect this SpaceObject's overlap Hitbox's rectangular
bounding box.
|
<O extends SpaceObject<T>> |
SpaceState.boundingBoxesMeet(Hitbox<T> hitbox,
java.lang.Class<O> cls)
Returns all of this SpaceState's SpaceObjects of the specified class
whose overlap Hitboxes' rectangular bounding boxes touch or intersect the
specified Hitbox's rectangular bounding box.
|
<O extends SpaceObject<T>> |
SpaceObject.intersectingSolidObject(java.lang.Class<O> cls)
Returns a solid SpaceObject of the specified class in this SpaceObject's
SpaceState whose solid Hitbox is overlapping it, or null if there is
none.
|
<O extends SpaceObject<T>> |
SpaceState.intersectingSolidObject(Hitbox<T> hitbox,
java.lang.Class<O> cls)
Returns one of this SpaceState's SpaceObjects of the specified class
whose solid Hitbox overlaps the specified Hitbox, or null if there is
none.
|
<O extends SpaceObject<T>> |
SpaceObject.intersectingSolidObjects(java.lang.Class<O> cls)
Returns all of the solid SpaceObjects of the specified class in this
SpaceObject's SpaceState whose solid Hitboxes are overlapping it.
|
<O extends SpaceObject<T>> |
SpaceState.intersectingSolidObjects(Hitbox<T> hitbox,
java.lang.Class<O> cls)
Returns all of this SpaceState's SpaceObjects of the specified class
whose solid Hitboxes overlap the specified Hitbox.
|
<O extends SpaceObject<T>> |
SpaceObject.isIntersectingSolidObject(java.lang.Class<O> cls)
Returns whether this SpaceObject is overlapping the solid Hitbox of a
solid SpaceObject of the specified class in its SpaceState.
|
<O extends SpaceObject<T>> |
SpaceState.isIntersectingSolidObject(Hitbox<T> hitbox,
java.lang.Class<O> cls)
Returns whether this SpaceState has any SpaceObjects of the specified
class whose solid Hitboxes overlap the specified Hitbox.
|
<O extends SpaceObject<T>> |
SpaceObject.isOverlappingObject(java.lang.Class<O> cls)
Returns whether this SpaceObject is overlapping a SpaceObject of the
specified class in its SpaceState.
|
<O extends SpaceObject<T>> |
SpaceState.isOverlappingObject(Hitbox<T> hitbox,
java.lang.Class<O> cls)
Returns whether this SpaceState has any SpaceObjects of the specified
class that overlap the specified Hitbox.
|
<O extends SpaceObject<T>> |
SpaceState.nearestIntersectingSolidObject(CellVector point,
Hitbox<T> hitbox,
java.lang.Class<O> cls)
Returns this SpaceState's SpaceObject of the specified class whose solid
Hitbox overlaps the specified Hitbox whose center is nearest to the
specified point, or null if there is none.
|
<O extends SpaceObject<T>> |
SpaceState.nearestIntersectingSolidObject(long pointX,
long pointY,
Hitbox<T> hitbox,
java.lang.Class<O> cls)
Returns this SpaceState's SpaceObject of the specified class whose solid
Hitbox overlaps the specified Hitbox whose center is nearest to the
specified point, or null if there is none.
|
<O extends SpaceObject<T>> |
SpaceState.nearestObject(CellVector point,
java.lang.Class<O> cls)
Returns this SpaceState's SpaceObject of the specified class whose center
is nearest to the specified point, or null if this SpaceState has no
SpaceObjects of that class.
|
<O extends SpaceObject<T>> |
SpaceObject.nearestObject(java.lang.Class<O> cls)
Returns the SpaceObject of the specified class in this SpaceObject's
SpaceState that is nearest to it.
|
<O extends SpaceObject<T>> |
SpaceState.nearestObject(long pointX,
long pointY,
java.lang.Class<O> cls)
Returns this SpaceState's SpaceObject of the specified class whose center
is nearest to the specified point, or null if this SpaceState has no
SpaceObjects of that class.
|
<O extends SpaceObject<T>> |
SpaceState.nearestObjectWithinCircle(CellVector point,
CellVector center,
long radius,
java.lang.Class<O> cls)
Returns this SpaceState's SpaceObject of the specified class within the
specified circular region whose center is nearest to the specified point,
or null if there is none.
|
<O extends SpaceObject<T>> |
SpaceObject.nearestObjectWithinCircle(CellVector center,
long radius,
java.lang.Class<O> cls)
Returns the SpaceObject of the specified class within the specified
circular region in this SpaceObject's SpaceState that is nearest to it.
|
<O extends SpaceObject<T>> |
SpaceObject.nearestObjectWithinCircle(long centerX,
long centerY,
long radius,
java.lang.Class<O> cls)
Returns the SpaceObject of the specified class within the specified
circular region in this SpaceObject's SpaceState that is nearest to it.
|
<O extends SpaceObject<T>> |
SpaceState.nearestObjectWithinCircle(long pointX,
long pointY,
long centerX,
long centerY,
long radius,
java.lang.Class<O> cls)
Returns this SpaceState's SpaceObject of the specified class within the
specified circular region whose center is nearest to the specified point,
or null if there is none.
|
<O extends SpaceObject<T>> |
SpaceObject.nearestObjectWithinRadius(long radius,
java.lang.Class<O> cls)
Returns the SpaceObject of the specified class within the specified
radius of this SpaceObject in its SpaceState that is nearest to it.
|
<O extends SpaceObject<T>> |
SpaceState.nearestObjectWithinRectangle(CellVector point,
long x1,
long y1,
long x2,
long y2,
java.lang.Class<O> cls)
Returns this SpaceState's SpaceObject of the specified class within the
specified rectangular region whose center is nearest to the specified
point, or null if there is none.
|
<O extends SpaceObject<T>> |
SpaceObject.nearestObjectWithinRectangle(long x1,
long y1,
long x2,
long y2,
java.lang.Class<O> cls)
Returns the SpaceObject of the specified class within the specified
rectangular region in this SpaceObject's SpaceState that is nearest to
it.
|
<O extends SpaceObject<T>> |
SpaceState.nearestObjectWithinRectangle(long pointX,
long pointY,
long x1,
long y1,
long x2,
long y2,
java.lang.Class<O> cls)
Returns this SpaceState's SpaceObject of the specified class within the
specified rectangular region whose center is nearest to the specified
point, or null if there is none.
|
<O extends SpaceObject<T>> |
SpaceState.nearestOverlappingObject(CellVector point,
Hitbox hitbox,
java.lang.Class<O> cls)
Returns this SpaceState's SpaceObject of the specified class that
overlaps the specified Hitbox whose center is nearest to the specified
point, or null if there is none.
|
<O extends SpaceObject<T>> |
SpaceObject.nearestOverlappingObject(Hitbox hitbox,
java.lang.Class<O> cls)
Returns the SpaceObject of the specified class that overlaps the
specified Hitbox in this SpaceObject's SpaceState that is nearest to it.
|
<O extends SpaceObject<T>> |
SpaceState.nearestOverlappingObject(long pointX,
long pointY,
Hitbox hitbox,
java.lang.Class<O> cls)
Returns this SpaceState's SpaceObject of the specified class that
overlaps the specified Hitbox whose center is nearest to the specified
point, or null if there is none.
|
<O extends SpaceObject<T>> |
SpaceState.objectIsWithinCircle(CellVector center,
long radius,
java.lang.Class<O> cls)
Returns whether this SpaceState has any SpaceObjects of the specified
class with their centers within the specified circular region.
|
<O extends SpaceObject<T>> |
SpaceState.objectIsWithinCircle(long centerX,
long centerY,
long radius,
java.lang.Class<O> cls)
Returns whether this SpaceState has any SpaceObjects of the specified
class with their centers within the specified circular region.
|
<O extends SpaceObject<T>> |
SpaceObject.objectIsWithinRadius(long radius,
java.lang.Class<O> cls)
Returns whether there are any SpaceObjects of the specified class within
the specified radius of this SpaceObject in its SpaceState.
|
<O extends SpaceObject<T>> |
SpaceState.objectIsWithinRectangle(long x1,
long y1,
long x2,
long y2,
java.lang.Class<O> cls)
Returns whether this SpaceState has any SpaceObjects of the specified
class with their centers within the specified rectangular region.
|
<O extends SpaceObject<T>> |
SpaceState.objectsWithinCircle(CellVector center,
long radius,
java.lang.Class<O> cls)
Returns all of this SpaceState's SpaceObjects of the specified class with
their centers within the specified circular region.
|
<O extends SpaceObject<T>> |
SpaceState.objectsWithinCircle(long centerX,
long centerY,
long radius,
java.lang.Class<O> cls)
Returns all of this SpaceState's SpaceObjects of the specified class with
their centers within the specified circular region.
|
<O extends SpaceObject<T>> |
SpaceObject.objectsWithinRadius(long radius,
java.lang.Class<O> cls)
Returns all of the SpaceObjects of the specified class within the
specified radius of this SpaceObject in its SpaceState.
|
<O extends SpaceObject<T>> |
SpaceState.objectsWithinRectangle(long x1,
long y1,
long x2,
long y2,
java.lang.Class<O> cls)
Returns all of this SpaceState's SpaceObjects of the specified class with
their centers within the specified rectangular region.
|
<O extends SpaceObject<T>> |
SpaceState.objectWithinCircle(CellVector center,
long radius,
java.lang.Class<O> cls)
Returns one of this SpaceState's SpaceObjects of the specified class with
its center within the specified circular region, or null if there is
none.
|
<O extends SpaceObject<T>> |
SpaceState.objectWithinCircle(long centerX,
long centerY,
long radius,
java.lang.Class<O> cls)
Returns one of this SpaceState's SpaceObjects of the specified class with
its center within the specified circular region, or null if there is
none.
|
<O extends SpaceObject<T>> |
SpaceObject.objectWithinRadius(long radius,
java.lang.Class<O> cls)
Returns a SpaceObject of the specified class within the specified radius
of this SpaceObject in its SpaceState, or null if there is none.
|
<O extends SpaceObject<T>> |
SpaceState.objectWithinRectangle(long x1,
long y1,
long x2,
long y2,
java.lang.Class<O> cls)
Returns one of this SpaceState's SpaceObjects of the specified class with
its center within the specified rectangular region, or null if there is
none.
|
<O extends SpaceObject<T>> |
SpaceObject.overlappingObject(java.lang.Class<O> cls)
Returns a SpaceObject of the specified class in this SpaceObject's
SpaceState that is overlapping it, or null if there is none.
|
<O extends SpaceObject<T>> |
SpaceState.overlappingObject(Hitbox<T> hitbox,
java.lang.Class<O> cls)
Returns one of this SpaceState's SpaceObjects of the specified class that
overlaps the specified Hitbox, or null if there is none.
|
<O extends SpaceObject<T>> |
SpaceObject.overlappingObjects(java.lang.Class<O> cls)
Returns all of the SpaceObjects of the specified class in this
SpaceObject's SpaceState that are overlapping it.
|
<O extends SpaceObject<T>> |
SpaceState.overlappingObjects(Hitbox<T> hitbox,
java.lang.Class<O> cls)
Returns all of this SpaceState's SpaceObjects of the specified class that
overlap the specified Hitbox.
|
<O extends SpaceObject<T>> |
ThinkerObject.solidBoundingBoxesMeet(java.lang.Class<O> cls)
Returns all of the solid SpaceObjects of the specified class in this
ThinkerObject's SpaceState whose solid Hitboxes' rectangular bounding
boxes touch or intersect this ThinkerObject's collision Hitbox's
rectangular bounding box.
|
<O extends SpaceObject<T>> |
SpaceState.solidBoundingBoxesMeet(Hitbox<T> hitbox,
java.lang.Class<O> cls)
Returns all of this SpaceState's solid SpaceObjects of the specified
class whose solid Hitboxes' rectangular bounding boxes touch or intersect
the specified Hitbox's rectangular bounding box.
|
Modifier and Type | Method and Description |
---|---|
SpaceObject<T> |
Viewport.getCamera()
Returns this Viewport's camera, or null if it has none.
|
SpaceObject<T> |
Hitbox.getObject()
Returns the SpaceObject that is using this Hitbox, directly or indirectly
as part of a CompositeHitbox, or null if it is not being used by a
SpaceObject.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<SpaceObject<T>,java.util.Set<Direction>> |
ThinkerObject.getCollisions()
Returns a Map of the SpaceObjects whose solid surfaces this ThinkerObject
collided with during its last movement to the Sets of the Directions in
which it collided with them.
|
abstract java.util.Collection<SpaceObject<T>> |
Area.load(T game,
SpaceState<T> state)
Actions for this Area to take in order for the specified SpaceState to
load it.
|
SafeIterator<SpaceObject<T>> |
SpaceState.objectIterator()
Returns a new Iterator over this SpaceState's list of SpaceObjects.
|
Modifier and Type | Method and Description |
---|---|
boolean |
SpaceState.addObject(SpaceObject<T> object)
Adds the specified SpaceObject to this SpaceState if it is not already
assigned to a SpaceState.
|
double |
SpaceObject.angleTo(SpaceObject object)
Returns the angle from this SpaceObject's center to the specified
SpaceObject's center.
|
CollisionResponse |
ThinkerObject.collide(SpaceObject<T> object,
Direction direction)
This ThinkerObject's response to colliding with a solid surface of the
specified SpaceObject in the specified Direction.
|
long |
SpaceObject.distanceTo(SpaceObject object)
Returns the distance from this SpaceObject's center to the specified
SpaceObject's center.
|
static <T extends CellGame> |
SpaceObject.overlap(SpaceObject<T> object1,
SpaceObject<T> object2)
Returns whether the two specified SpaceObjects overlap.
|
static <T extends CellGame> |
SpaceObject.overlap(SpaceObject<T> object1,
SpaceObject<T> object2)
Returns whether the two specified SpaceObjects overlap.
|
boolean |
SpaceObject.overlaps(SpaceObject<T> object)
Returns whether this SpaceObject overlaps the specified SpaceObject.
|
boolean |
SpaceState.removeObject(SpaceObject<T> object)
Removes the specified SpaceObject from this SpaceState if it is currently
assigned to it.
|
void |
Viewport.setCamera(SpaceObject<T> camera)
Sets this Viewport's camera to the specified SpaceObject, or to none if
the specified SpaceObject is null.
|
Constructor and Description |
---|
SpaceObject(Hitbox<T> locatorHitbox,
SpaceObject<T> creator)
Creates a new SpaceObject with the specified locator Hitbox that acts as
if it was created by the specified SpaceObject, initially copying its
creator's time factor, flipped status, and angle of rotation.
|
ThinkerObject(Hitbox<T> locatorHitbox,
SpaceObject<T> creator)
Creates a new ThinkerObject with the specified locator Hitbox that acts
as if it was created by the specified SpaceObject, initially copying its
creator's time factor, flipped status, and angle of rotation.
|