Package | Description |
---|---|
org.cell2d | |
org.cell2d.space | |
org.cell2d.space.basic | |
org.cell2d.space.map |
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 |
MobileObject
A MobileObject is a SpaceObject that can simulate continuous movement
through its SpaceState's space.
|
class |
ThinkerObject<T extends CellGame,U extends SpaceState<T,U,V>,V extends SpaceThinker<T,U,V>>
A ThinkerObject is a MobileObject that mimics a type of SpaceThinker by
permanently assigning to itself a SpaceThinker of that type.
|
Modifier and Type | Method and Description |
---|---|
<O extends SpaceObject> |
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> |
SpaceState.boundingBoxesMeet(Hitbox 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> |
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> |
SpaceState.intersectingSolidObject(Hitbox 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> |
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> |
SpaceState.intersectingSolidObjects(Hitbox 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> |
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> |
SpaceState.isIntersectingSolidObject(Hitbox 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> |
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> |
SpaceState.isOverlappingObject(Hitbox 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> |
SpaceState.nearestIntersectingSolidObject(CellVector point,
Hitbox 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> |
SpaceState.nearestIntersectingSolidObject(long pointX,
long pointY,
Hitbox 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> |
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> |
SpaceObject.nearestObject(java.lang.Class<O> cls)
Returns the SpaceObject of the specified class that is nearest to this
SpaceObject in its SpaceState - or null if this SpaceObject has no
SpaceState, or its SpaceState contains no SpaceObject of that class.
|
<O extends SpaceObject> |
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> |
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> |
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 -
or null if this SpaceObject has no SpaceState, or the region contains no
SpaceObject of that class.
|
<O extends SpaceObject> |
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 -
or null if this SpaceObject has no SpaceState, or the region contains no
SpaceObject of that class.
|
<O extends SpaceObject> |
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> |
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 - or
null if there is none, or if this SpaceObject has no SpaceState.
|
<O extends SpaceObject> |
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> |
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 - or null if this SpaceObject has no SpaceState, or the region
contains no SpaceObject of that class.
|
<O extends SpaceObject> |
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> |
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> |
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 -
or null if this SpaceObject has no SpaceState, or no SpaceObject of that
class is overlapping the Hitbox.
|
<O extends SpaceObject> |
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> |
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> |
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> |
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, or false if
this SpaceObject has no SpaceState.
|
<O extends SpaceObject> |
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> |
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> |
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> |
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, or an empty list
if this SpaceObject has no SpaceState.
|
<O extends SpaceObject> |
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> |
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> |
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> |
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, or if
this SpaceObject has no SpaceState.
|
<O extends SpaceObject> |
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> |
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> |
SpaceState.overlappingObject(Hitbox 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> |
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> |
SpaceState.overlappingObjects(Hitbox 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> |
MobileObject.solidBoundingBoxesMeet(java.lang.Class<O> cls)
Returns all of the solid SpaceObjects of the specified class in this
MobileObject's SpaceState whose solid Hitboxes' rectangular bounding
boxes touch or intersect this MobileObject's collision Hitbox's
rectangular bounding box.
|
<O extends SpaceObject> |
SpaceState.solidBoundingBoxesMeet(Hitbox 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 |
Viewport.getCamera()
Returns this Viewport's camera, or null if it has none.
|
SpaceObject |
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,java.util.Set<Direction>> |
MobileObject.getCollisions()
Returns a Map of the SpaceObjects whose solid surfaces this MobileObject
collided with during its last movement to the Sets of the Directions in
which it collided with them.
|
java.lang.Iterable<SpaceObject> |
Area.load(T game,
U state)
Actions for this Area to take to in order for the specified SpaceState to
load it.
|
SafeIterator<SpaceObject> |
SpaceState.objectIterator()
Returns a new SafeIterator over this SpaceState's list of SpaceObjects.
|
Modifier and Type | Method and Description |
---|---|
boolean |
SpaceState.addObject(SpaceObject 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 |
MobileObject.collide(SpaceObject object,
Direction direction)
This MobileObject'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 boolean |
SpaceObject.overlap(SpaceObject object1,
SpaceObject object2)
Returns whether the two specified SpaceObjects overlap.
|
boolean |
SpaceObject.overlaps(SpaceObject object)
Returns whether this SpaceObject overlaps the specified SpaceObject.
|
boolean |
SpaceState.removeObject(SpaceObject object)
Removes the specified SpaceObject from this SpaceState if it is currently
assigned to it.
|
void |
Viewport.setCamera(SpaceObject camera)
Sets this Viewport's camera to the specified SpaceObject, or to none if
the specified SpaceObject is null.
|
Modifier and Type | Class and Description |
---|---|
class |
BasicThinkerObject
A BasicThinkerObject is a type of ThinkerObject that mimics a
BasicSpaceThinker, which has no special capabilities.
|
Modifier and Type | Class and Description |
---|---|
class |
TileGridObject
A TileGridObject is a type of SpaceObject that spatially instantiates a
TileGrid, which is specified upon the TileGridObject's creation.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Iterable<SpaceObject> |
TiledArea.load(T game,
U state) |
java.lang.Iterable<SpaceObject> |
TiledArea.loadImageLayer(T game,
U state,
org.tiledreader.TiledImageLayer layer,
int drawPriority)
Generates a set of SpaceObjects to represent the specified
TiledImageLayer.
|
abstract java.lang.Iterable<SpaceObject> |
TiledArea.loadObjectLayer(T game,
U state,
org.tiledreader.TiledObjectLayer layer,
int drawPriority)
Generates a set of SpaceObjects to represent the specified
TiledObjectLayer.
|
java.lang.Iterable<SpaceObject> |
TiledArea.loadTileLayer(T game,
U state,
org.tiledreader.TiledTileLayer layer,
int drawPriority)
Generates a set of SpaceObjects to represent the specified
TiledTileLayer.
|