CMObject
, Tickable
, CMLibrary
, GalacticMap
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
public class CoffeeDark extends StdLibrary implements GalacticMap
Modifier and Type | Field | Description |
---|---|---|
protected static java.math.BigDecimal |
ALMOST_ZERO |
|
protected static java.math.BigDecimal |
FOUR |
|
protected static java.math.BigDecimal |
MIN_ONE |
|
protected static java.math.BigDecimal |
ONE |
|
protected static java.math.BigDecimal |
ONE_THOUSAND |
|
protected static double |
PI_ALMOST |
|
protected static double |
PI_BY_12 |
|
protected static double |
PI_BY_2 |
|
protected static double |
PI_TIMES_1ANDAHALF |
|
protected static double |
PI_TIMES_2 |
|
protected static double |
PI_TIMES_2_ALMOST |
|
protected int |
QUADRANT_WIDTH |
|
protected java.util.Map<java.lang.String,BoundedObject.BoundedCube> |
sectorMap |
|
protected RTree<SpaceObject> |
space |
|
protected static java.math.BigDecimal |
TEN |
|
protected static java.math.BigDecimal |
TWO |
|
protected static java.math.BigDecimal |
ZERO |
|
protected static double |
ZERO_ALMOST |
idConverter
isDebugging, name, serviceClient, tickStatus
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BALLISTICK, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EVENT, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SHORTERMASK, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
Constructor | Description |
---|---|
CoffeeDark() |
Modifier and Type | Method | Description |
---|---|---|
double |
accelSpaceObject(double[] curDirection,
double curSpeed,
double[] accelDirection,
double newAcceleration) |
This method does not actually move anything, but returns a change in direction, and
a change in speed caused by an acceleration in a new direction.
|
void |
accelSpaceObject(SpaceObject O,
double[] accelDirection,
double newAcceleration) |
This method does not actually move anything, but given a space object, and an
acceleration direction and an acceleration speed, this will alter the space objects
direction and speed based on the new acceleration.
|
boolean |
activate() |
Activates the library.
|
void |
addObjectToSpace(SpaceObject O) |
Adds the given SpaceObject to the galactic map cache.
|
void |
addObjectToSpace(SpaceObject O,
long[] coords) |
Adds the given SpaceObject to the galactic map cache
at the given coordinates.
|
void |
applyAngleDiff(double[] angle,
double[] delta) |
Given an angle and a simple delta, with positive and negative values,
this will add the delta to the angle and normalize the angle.
|
static java.math.BigDecimal |
bigSqrt(java.math.BigDecimal A) |
|
Pair<double[],java.lang.Long> |
calculateIntercept(SpaceObject chaserO,
SpaceObject runnerO,
long maxChaserSpeed,
int maxTicks) |
Returns the proper direction and speed to allow the given chaser to intercept the given runner.
|
Pair<double[],java.lang.Long> |
calculateIntercept2(SpaceObject chaserO,
SpaceObject runnerO,
long maxChaserSpeed,
int maxTicks) |
|
boolean |
canMaybeIntercept(SpaceObject chaserO,
SpaceObject runnerO,
int maxTicks,
double maxSpeed) |
Returns whether the vectors described by the chaser and runners, their speeds, and the amount of time in
movement can even POSSIBLY intercept, because the two vectors overlap
|
void |
changeDirection(double[] dir,
double[] delta) |
Changes the given direction by the given delta variable.
|
void |
changeDirection(double[] dir,
double delta0,
double delta1) |
Changes the given direction by the given delta variables.
|
void |
delObjectInSpace(SpaceObject O) |
Removes a SpaceObject from the galactic map cache.
|
SpaceObject |
findSpaceObject(java.lang.String s,
boolean exactOnly) |
Given the name of an object in space, preferably a unique name, this will attempt to find and return it
using standard search methods.
|
protected void |
fixDirectionBounds(double[] dir) |
|
ShipDirectional.ShipDir |
getAbsoluteDirectionalFromDir(double[] direction) |
Given a direction this will return a relative direction object describing
the directions absolute facing.
|
double |
getAngleDelta(double[] fromAngle,
double[] toAngle) |
Given two angles, this returns the difference between them as a single angle.
|
double[] |
getAngleDiff(double[] fromAngle,
double[] toAngle) |
Given two angles, this returns the difference between them in pitch and yaw.
|
protected double[] |
getBigDirection(long[] fromCoords,
long[] toCoords) |
|
protected java.math.BigDecimal |
getBigDistanceFrom(long[] coord1,
long[] coord2) |
|
ShipDirectional.ShipDir[] |
getCurrentBattleCoveredDirections(ShipDirectional comp) |
Given a ship war component, returns the directions in which it is
currently covering.
|
protected double |
getDirDiffSum(double[] d1,
double[] d2) |
|
double[] |
getDirection(long[] fromCoords,
long[] toCoords) |
Given two galactic coordinates, this will return the direction in radians
from the first to the second.
|
double[] |
getDirection(SpaceObject fromObj,
SpaceObject toObj) |
Given two space objects, this will return the direction in radians
from the first to the second.
|
ShipDirectional.ShipDir |
getDirectionFromDir(double[] facing,
double roll,
double[] direction) |
Given a facing direction (NOT direction of travel), and a roll angle (belly/axis), and a
direction to some other object, this will return a relative direction object describing
the ships relationship to the other object.
|
long |
getDistanceFrom(long[] coord1,
long[] coord2) |
Given two galactic coordinates, this returns the actual
distance between the two.
|
long |
getDistanceFrom(SpaceObject O1,
SpaceObject O2) |
Given two space objects, this returns the actual
distance between the two.
|
double |
getGravityForce(SpaceObject S,
SpaceObject cO) |
If the two given objects are within an appropriate distance
from each other, this will return the correct amount of
acceleration g-force applied by the second object to the
first.
|
long[] |
getInSectorCoords(long[] coords) |
Given absolute space coordinates, from -Long.MAX to Long.MAX,
this will return the relative coordinates INSIDE the
sector, whose bounds are determined by lots of math.
|
java.util.List<LocationRoom> |
getLandingPoints(SpaceObject ship,
Environmental O) |
Given a space ship, and an object that can be reduced to an Area, this will
return a list of all valid LocationRoom objects, sorted by their present
distance from the ship, from each other, and whether its a space port.
|
long[] |
getLocation(long[] oldLocation,
double[] direction,
long distance) |
Given some galactic coordinates, a direction of travel, and a distance, this will
return the new coordinates.
|
double[] |
getMiddleAngle(double[] angle1,
double[] angle2) |
Given two angles, this returns the angle between them.
|
double |
getMinDistanceFrom(long[] prevPos,
long[] curPos,
long[] objPos) |
Given a previous position and a current position, this will return the minimum
distance approached to the given object position.
|
double[] |
getOffsetAngle(double[] correctAngle,
double[] wrongAngle) |
Given a base 'correct' angle and another 'wrong' angle, this will return
the angle that it opposite to, but equal in distance.
|
protected double |
getOldMinDistFrom(long[] prevPos,
double speed,
double[] dir,
long[] curPosition,
double[] directionTo,
long[] objPos) |
|
double[] |
getOppositeDir(double[] dir) |
Given a direction, this will return its opposite
|
double[][] |
getPerpendicularAngles(double[] angle) |
Given an angle from origin, this will return the other
trivial angles that are 90 degrees from the given one.
|
long[][] |
getPerpendicularPoints(long[] origin,
double[] angle,
long distance) |
Given the origin point and an angle from the origin, this
will return the other points that are 90 degrees from the
given one, at the given distance.
|
long |
getRelativeSpeed(SpaceObject O1,
SpaceObject O2) |
Calculates the relative speed of two SpaceObjects to each other.
|
java.util.Map<java.lang.String,BoundedObject.BoundedCube> |
getSectorMap() |
Returns the name of all the sectors, and the cube
that covers its domain.
|
java.lang.String |
getSectorName(long[] coords) |
Given some absolute space coordinates, this will return
the name of the sector the coordinates are in.
|
SpaceObject |
getSpaceObject(CMObject o,
boolean ignoreMobs) |
Given a random object, this will return null, or the "nearest" space object,
by crawling up an item container tree, or however it needs to.
|
java.util.Enumeration<java.util.Map.Entry<SpaceObject,java.util.List<java.lang.ref.WeakReference<TrackingVector<SpaceObject>>>>> |
getSpaceObjectEntries() |
Returns an enumeration of all objects, along with a list of their tracking vectors?
I have no idea why anyone would want this, so I won't explain any more until someone
does try to use this.
|
java.util.Enumeration<SpaceObject> |
getSpaceObjects() |
Returns an enumeration of all object in the galactic space map.
|
java.util.List<SpaceObject> |
getSpaceObjectsByCenterpointWithin(long[] centerCoordinates,
long minDistance,
long maxDistance) |
Given a center galactic coordinates, and a minimum and maximum distance from that coordinate, this will
return all objects in the caches space map that is within the "donut" defined by those things.
|
java.util.List<SpaceObject> |
getSpaceObjectsInBound(BoundedObject.BoundedCube cube) |
Given a bounded cube, this will return all space objects within that cube,
and by within, i mean even just intersecting it.
|
java.util.List<SpaceObject> |
getSpaceObjectsWithin(SpaceObject ofObj,
long minDistance,
long maxDistance) |
Given a space object to use as a center point on the galactic map, this will
return all objects in the caches space map that is within the "donut" defined by those things.
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
boolean |
isObjectInSpace(SpaceObject O) |
Returns whether the given object is actually in
the galactic map cache at the moment -- it could
be landed somewhere.
|
protected BoundedObject.BoundedCube |
makeCourseCubeRay(long[] src,
long sradius,
long[] target,
long tradius,
double[] dir) |
|
long[] |
moveSpaceObject(long[] coordinates,
double[] direction,
long speed) |
Given a set of galactic coordinates, and a direction angle, and a speed, this will return
the new coordinates after applying all the inputs.
|
void |
moveSpaceObject(SpaceObject O) |
Given a SpaceObject that is moving, this will alter the given objects
coordinates based on its speed and direction.
|
void |
moveSpaceObject(SpaceObject O,
long[] coords) |
Given a SpaceObject and its coordinates, this will alter the given coordinates
based on the speed and direction of the given space object.
|
protected void |
moveSpaceObject(SpaceObject O,
long x,
long y,
long z) |
|
int |
numSpaceObjects() |
Returns the number of objects in the galactic map
cache.
|
java.util.List<long[]> |
plotCourse(long[] osrc,
long sradius,
long[] otarget,
long tradius,
int maxTicks) |
Plots a course from the source to the target, with a maximum number of steps/ticks.
|
void |
runSpace() |
|
boolean |
sendSpaceEmissionEvent(SpaceObject srcP,
Environmental tool,
int emissionType,
java.lang.String msgStr) |
Generates an sends a message representing an emission in space,
which might be picked up by various sensors.
|
boolean |
sendSpaceEmissionEvent(SpaceObject srcP,
Environmental tool,
long range,
int emissionType,
java.lang.String msgStr) |
Generates an sends a message representing an emission in space,
which might be picked up by various sensors.
|
boolean |
shutdown() |
Shuts down the library.
|
java.util.Enumeration<Area> |
spaceAreas() |
Returns an enumeration of all Areas that are also
SpaceObjects, typically planets.
|
protected void |
swapTargetTool(CMMsg msg) |
|
boolean |
tick(Tickable ticking,
int tickID) |
this is the method which is called periodically by the threading engine.
|
getServiceClient, L, propertiesLoaded
copyOf, initializeClass, name, newInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatus
protected static final double ZERO_ALMOST
protected static final java.math.BigDecimal ZERO
protected static final java.math.BigDecimal ALMOST_ZERO
protected static final java.math.BigDecimal ONE
protected static final java.math.BigDecimal MIN_ONE
protected static final java.math.BigDecimal TWO
protected static final java.math.BigDecimal FOUR
protected static final java.math.BigDecimal TEN
protected static final java.math.BigDecimal ONE_THOUSAND
protected static final double PI_ALMOST
protected static final double PI_TIMES_2_ALMOST
protected static final double PI_TIMES_2
protected static final double PI_BY_2
protected static final double PI_BY_12
protected static final double PI_TIMES_1ANDAHALF
protected final int QUADRANT_WIDTH
protected final RTree<SpaceObject> space
protected final java.util.Map<java.lang.String,BoundedObject.BoundedCube> sectorMap
public java.lang.String ID()
CMObject
ID
in interface CMObject
ID
in class StdLibrary
public boolean isObjectInSpace(SpaceObject O)
GalacticMap
isObjectInSpace
in interface GalacticMap
O
- the space object to look forGalacticMap.numSpaceObjects()
,
GalacticMap.isObjectInSpace(SpaceObject)
,
GalacticMap.delObjectInSpace(SpaceObject)
,
GalacticMap.addObjectToSpace(SpaceObject, long[])
,
GalacticMap.addObjectToSpace(SpaceObject)
,
GalacticMap.findSpaceObject(String, boolean)
public void delObjectInSpace(SpaceObject O)
GalacticMap
delObjectInSpace
in interface GalacticMap
O
- the object to removeGalacticMap.numSpaceObjects()
,
GalacticMap.isObjectInSpace(SpaceObject)
,
GalacticMap.delObjectInSpace(SpaceObject)
,
GalacticMap.addObjectToSpace(SpaceObject, long[])
,
GalacticMap.addObjectToSpace(SpaceObject)
,
GalacticMap.findSpaceObject(String, boolean)
public void addObjectToSpace(SpaceObject O, long[] coords)
GalacticMap
addObjectToSpace
in interface GalacticMap
O
- the SpaceObject to addcoords
- the coordinates to add it atGalacticMap.numSpaceObjects()
,
GalacticMap.isObjectInSpace(SpaceObject)
,
GalacticMap.delObjectInSpace(SpaceObject)
,
GalacticMap.addObjectToSpace(SpaceObject, long[])
,
GalacticMap.addObjectToSpace(SpaceObject)
,
GalacticMap.findSpaceObject(String, boolean)
public void addObjectToSpace(SpaceObject O)
GalacticMap
addObjectToSpace
in interface GalacticMap
O
- the object to put in spaceGalacticMap.numSpaceObjects()
,
GalacticMap.isObjectInSpace(SpaceObject)
,
GalacticMap.delObjectInSpace(SpaceObject)
,
GalacticMap.addObjectToSpace(SpaceObject, long[])
,
GalacticMap.addObjectToSpace(SpaceObject)
,
GalacticMap.findSpaceObject(String, boolean)
public java.util.Enumeration<Area> spaceAreas()
GalacticMap
spaceAreas
in interface GalacticMap
public long getDistanceFrom(long[] coord1, long[] coord2)
GalacticMap
getDistanceFrom
in interface GalacticMap
coord1
- first galactic coordscoord2
- second galactic coordsGalacticMap.getDistanceFrom(long[], long[])
,
GalacticMap.getDistanceFrom(SpaceObject, SpaceObject)
,
GalacticMap.getMinDistanceFrom(long[], long[], long[])
public long getDistanceFrom(SpaceObject O1, SpaceObject O2)
GalacticMap
getDistanceFrom
in interface GalacticMap
O1
- the first space objectO2
- the second space objectGalacticMap.getDistanceFrom(long[], long[])
,
GalacticMap.getDistanceFrom(SpaceObject, SpaceObject)
,
GalacticMap.getMinDistanceFrom(long[], long[], long[])
public double[][] getPerpendicularAngles(double[] angle)
GalacticMap
getPerpendicularAngles
in interface GalacticMap
angle
- the angle from originpublic long[][] getPerpendicularPoints(long[] origin, double[] angle, long distance)
GalacticMap
getPerpendicularPoints
in interface GalacticMap
origin
- the origin pointsangle
- the angle from origindistance
- the distance from origin of the points to returnGalacticMap.getPerpendicularAngles(double[])
protected java.math.BigDecimal getBigDistanceFrom(long[] coord1, long[] coord2)
public java.lang.String getSectorName(long[] coords)
GalacticMap
getSectorName
in interface GalacticMap
coords
- the space coordinatesGalacticMap.getInSectorCoords(long[])
public long[] getInSectorCoords(long[] coords)
GalacticMap
getInSectorCoords
in interface GalacticMap
coords
- the space coordinatesGalacticMap.getSectorName(long[])
public java.util.Map<java.lang.String,BoundedObject.BoundedCube> getSectorMap()
GalacticMap
getSectorMap
in interface GalacticMap
public void accelSpaceObject(SpaceObject O, double[] accelDirection, double newAcceleration)
GalacticMap
accelSpaceObject
in interface GalacticMap
O
- the space object to modifyaccelDirection
- the acceleration directionnewAcceleration
- the acceleration amountGalacticMap.accelSpaceObject(double[], double, double[], double)
public double getAngleDelta(double[] fromAngle, double[] toAngle)
GalacticMap
getAngleDelta
in interface GalacticMap
fromAngle
- the first angletoAngle
- the second angleGalacticMap.getAngleDiff(double[], double[])
public double[] getMiddleAngle(double[] angle1, double[] angle2)
GalacticMap
getMiddleAngle
in interface GalacticMap
angle1
- the first angleangle2
- the second anglepublic double[] getOffsetAngle(double[] correctAngle, double[] wrongAngle)
GalacticMap
getOffsetAngle
in interface GalacticMap
correctAngle
- the base anglewrongAngle
- the wrong anglepublic void applyAngleDiff(double[] angle, double[] delta)
GalacticMap
applyAngleDiff
in interface GalacticMap
angle
- the angle to modifydelta
- the deltapublic double[] getAngleDiff(double[] fromAngle, double[] toAngle)
GalacticMap
getAngleDiff
in interface GalacticMap
fromAngle
- the first angletoAngle
- the second angleGalacticMap.getAngleDelta(double[], double[])
public double accelSpaceObject(double[] curDirection, double curSpeed, double[] accelDirection, double newAcceleration)
GalacticMap
accelSpaceObject
in interface GalacticMap
curDirection
- the current direction, *AND* the new directioncurSpeed
- the current speedaccelDirection
- the direction of accelerationnewAcceleration
- the amount of accelerationGalacticMap.accelSpaceObject(double[], double, double[], double)
protected void fixDirectionBounds(double[] dir)
public void changeDirection(double[] dir, double delta0, double delta1)
GalacticMap
changeDirection
in interface GalacticMap
dir
- the current direction to changedelta0
- the port/starboard deltadelta1
- the ventral/dorsel deltapublic void changeDirection(double[] dir, double[] delta)
GalacticMap
changeDirection
in interface GalacticMap
dir
- the current direction to changedelta
- the delta to change it by, + or -public double[] getOppositeDir(double[] dir)
GalacticMap
getOppositeDir
in interface GalacticMap
dir
- the directionGalacticMap.getDirection(long[], long[])
,
GalacticMap.getDirection(SpaceObject, SpaceObject)
,
GalacticMap.getDirectionFromDir(double[], double, double[])
,
GalacticMap.getOppositeDir(double[])
public ShipDirectional.ShipDir getDirectionFromDir(double[] facing, double roll, double[] direction)
GalacticMap
getDirectionFromDir
in interface GalacticMap
facing
- the direction of facingroll
- the roll angledirection
- the direction to the other objectShipDirectional.ShipDir
,
GalacticMap.getDirection(long[], long[])
,
GalacticMap.getDirection(SpaceObject, SpaceObject)
,
GalacticMap.getDirectionFromDir(double[], double, double[])
,
GalacticMap.getOppositeDir(double[])
,
GalacticMap.getAbsoluteDirectionalFromDir(double[])
public ShipDirectional.ShipDir getAbsoluteDirectionalFromDir(double[] direction)
GalacticMap
getAbsoluteDirectionalFromDir
in interface GalacticMap
direction
- the direction to the other objectShipDirectional.ShipDir
,
GalacticMap.getDirection(long[], long[])
,
GalacticMap.getDirection(SpaceObject, SpaceObject)
,
GalacticMap.getDirectionFromDir(double[], double, double[])
,
GalacticMap.getOppositeDir(double[])
,
GalacticMap.getDirectionFromDir(double[], double, double[])
public double[] getDirection(SpaceObject fromObj, SpaceObject toObj)
GalacticMap
getDirection
in interface GalacticMap
fromObj
- the first SpaceObjecttoObj
- the second SpaceObjectGalacticMap.getDirection(long[], long[])
,
GalacticMap.getDirection(SpaceObject, SpaceObject)
,
GalacticMap.getDirectionFromDir(double[], double, double[])
,
GalacticMap.getOppositeDir(double[])
protected void moveSpaceObject(SpaceObject O, long x, long y, long z)
public void moveSpaceObject(SpaceObject O, long[] coords)
GalacticMap
moveSpaceObject
in interface GalacticMap
O
- the space object that is movingcoords
- the coordinates to modify based on speed/dir of the objectGalacticMap.moveSpaceObject(SpaceObject)
,
GalacticMap.moveSpaceObject(long[], double[], long)
,
GalacticMap.getLocation(long[], double[], long)
public void moveSpaceObject(SpaceObject O)
GalacticMap
moveSpaceObject
in interface GalacticMap
O
- the SpaceObject to moveGalacticMap.moveSpaceObject(SpaceObject, long[])
,
GalacticMap.moveSpaceObject(long[], double[], long)
,
GalacticMap.getLocation(long[], double[], long)
public double[] getDirection(long[] fromCoords, long[] toCoords)
GalacticMap
getDirection
in interface GalacticMap
fromCoords
- the first coordinatestoCoords
- the second coordinatesGalacticMap.getDirection(long[], long[])
,
GalacticMap.getDirection(SpaceObject, SpaceObject)
,
GalacticMap.getDirectionFromDir(double[], double, double[])
,
GalacticMap.getOppositeDir(double[])
protected double[] getBigDirection(long[] fromCoords, long[] toCoords)
public long[] moveSpaceObject(long[] coordinates, double[] direction, long speed)
GalacticMap
moveSpaceObject
in interface GalacticMap
coordinates
- the galactic coordinatesdirection
- the direction anglespeed
- the speedGalacticMap.moveSpaceObject(SpaceObject)
,
GalacticMap.moveSpaceObject(SpaceObject, long[])
,
GalacticMap.getLocation(long[], double[], long)
public long[] getLocation(long[] oldLocation, double[] direction, long distance)
GalacticMap
getLocation
in interface GalacticMap
oldLocation
- the previous locationdirection
- the direction of traveldistance
- the distance of travelGalacticMap.moveSpaceObject(SpaceObject)
,
GalacticMap.moveSpaceObject(SpaceObject, long[])
,
GalacticMap.moveSpaceObject(long[], double[], long)
public long getRelativeSpeed(SpaceObject O1, SpaceObject O2)
GalacticMap
getRelativeSpeed
in interface GalacticMap
O1
- the first Space ObjectO2
- the second Space Objectpublic SpaceObject findSpaceObject(java.lang.String s, boolean exactOnly)
GalacticMap
findSpaceObject
in interface GalacticMap
s
- the search stringexactOnly
- true to only match full terms, false for partial matchesGalacticMap.getSpaceObjects()
,
GalacticMap.getSpaceObjectEntries()
,
GalacticMap.getSpaceObjectsWithin(SpaceObject, long, long)
,
GalacticMap.getSpaceObjectsByCenterpointWithin(long[], long, long)
,
GalacticMap.getSpaceObject(CMObject, boolean)
,
GalacticMap.getSpaceObjectsInBound(BoundedCube)
public SpaceObject getSpaceObject(CMObject o, boolean ignoreMobs)
GalacticMap
getSpaceObject
in interface GalacticMap
o
- the game object, of almost any sort (item, area, room, mob)ignoreMobs
- true to return null on mobs, false otherwiseGalacticMap.getSpaceObjects()
,
GalacticMap.getSpaceObjectEntries()
,
GalacticMap.getSpaceObjectsWithin(SpaceObject, long, long)
,
GalacticMap.getSpaceObjectsByCenterpointWithin(long[], long, long)
,
GalacticMap.findSpaceObject(String, boolean)
,
GalacticMap.getSpaceObjectsInBound(BoundedCube)
public java.util.Enumeration<SpaceObject> getSpaceObjects()
GalacticMap
getSpaceObjects
in interface GalacticMap
GalacticMap.getSpaceObjectEntries()
,
GalacticMap.getSpaceObjectsWithin(SpaceObject, long, long)
,
GalacticMap.getSpaceObjectsByCenterpointWithin(long[], long, long)
,
GalacticMap.findSpaceObject(String, boolean)
,
GalacticMap.getSpaceObject(CMObject, boolean)
public java.util.Enumeration<java.util.Map.Entry<SpaceObject,java.util.List<java.lang.ref.WeakReference<TrackingVector<SpaceObject>>>>> getSpaceObjectEntries()
GalacticMap
getSpaceObjectEntries
in interface GalacticMap
GalacticMap.getSpaceObjects()
,
GalacticMap.getSpaceObjectsWithin(SpaceObject, long, long)
,
GalacticMap.getSpaceObjectsByCenterpointWithin(long[], long, long)
,
GalacticMap.findSpaceObject(String, boolean)
,
GalacticMap.getSpaceObject(CMObject, boolean)
,
GalacticMap.getSpaceObjectsInBound(BoundedCube)
public java.util.List<SpaceObject> getSpaceObjectsByCenterpointWithin(long[] centerCoordinates, long minDistance, long maxDistance)
GalacticMap
getSpaceObjectsByCenterpointWithin
in interface GalacticMap
centerCoordinates
- the full galactic coordinates of the center pointminDistance
- the minimum distance to returnmaxDistance
- the maximum distance to returnGalacticMap.getSpaceObjects()
,
GalacticMap.getSpaceObjectEntries()
,
GalacticMap.getSpaceObjectsWithin(SpaceObject, long, long)
,
GalacticMap.findSpaceObject(String, boolean)
,
GalacticMap.getSpaceObject(CMObject, boolean)
,
GalacticMap.getSpaceObjectsInBound(BoundedCube)
public java.util.List<SpaceObject> getSpaceObjectsInBound(BoundedObject.BoundedCube cube)
GalacticMap
getSpaceObjectsInBound
in interface GalacticMap
cube
- the cube to look withinGalacticMap.getSpaceObjects()
,
GalacticMap.getSpaceObjectEntries()
,
GalacticMap.getSpaceObjectsByCenterpointWithin(long[], long, long)
,
GalacticMap.findSpaceObject(String, boolean)
,
GalacticMap.getSpaceObject(CMObject, boolean)
public java.util.List<SpaceObject> getSpaceObjectsWithin(SpaceObject ofObj, long minDistance, long maxDistance)
GalacticMap
getSpaceObjectsWithin
in interface GalacticMap
ofObj
- the space object to use as a center pointminDistance
- the minimum distance to returnmaxDistance
- the maximum distance to returnGalacticMap.getSpaceObjects()
,
GalacticMap.getSpaceObjectEntries()
,
GalacticMap.getSpaceObjectsByCenterpointWithin(long[], long, long)
,
GalacticMap.findSpaceObject(String, boolean)
,
GalacticMap.getSpaceObject(CMObject, boolean)
,
GalacticMap.getSpaceObjectsInBound(BoundedCube)
public java.util.List<LocationRoom> getLandingPoints(SpaceObject ship, Environmental O)
GalacticMap
getLandingPoints
in interface GalacticMap
ship
- the ship looking for a landing spotO
- an area, room, boardable, whateverpublic int numSpaceObjects()
GalacticMap
numSpaceObjects
in interface GalacticMap
public static java.math.BigDecimal bigSqrt(java.math.BigDecimal A)
public boolean canMaybeIntercept(SpaceObject chaserO, SpaceObject runnerO, int maxTicks, double maxSpeed)
GalacticMap
canMaybeIntercept
in interface GalacticMap
chaserO
- the chasing objectrunnerO
- the running objectmaxTicks
- the maximum number of movementsmaxSpeed
- the max speed of the chaserGalacticMap.calculateIntercept(SpaceObject, SpaceObject, long, int)
public Pair<double[],java.lang.Long> calculateIntercept(SpaceObject chaserO, SpaceObject runnerO, long maxChaserSpeed, int maxTicks)
GalacticMap
calculateIntercept
in interface GalacticMap
chaserO
- the chasing objectrunnerO
- the running objectmaxChaserSpeed
- the max chasing speedmaxTicks
- the maximum number of movementsGalacticMap.canMaybeIntercept(SpaceObject, SpaceObject, int, double)
public Pair<double[],java.lang.Long> calculateIntercept2(SpaceObject chaserO, SpaceObject runnerO, long maxChaserSpeed, int maxTicks)
protected final double getDirDiffSum(double[] d1, double[] d2)
public double getMinDistanceFrom(long[] prevPos, long[] curPos, long[] objPos)
GalacticMap
getMinDistanceFrom
in interface GalacticMap
prevPos
- previous position on galactic chartcurPos
- current position on galactic chartobjPos
- the object position curious about minimum distance toGalacticMap.getDistanceFrom(long[], long[])
,
GalacticMap.getDistanceFrom(SpaceObject, SpaceObject)
,
GalacticMap.getMinDistanceFrom(long[], long[], long[])
protected double getOldMinDistFrom(long[] prevPos, double speed, double[] dir, long[] curPosition, double[] directionTo, long[] objPos)
public ShipDirectional.ShipDir[] getCurrentBattleCoveredDirections(ShipDirectional comp)
GalacticMap
getCurrentBattleCoveredDirections
in interface GalacticMap
comp
- the war componentprotected BoundedObject.BoundedCube makeCourseCubeRay(long[] src, long sradius, long[] target, long tradius, double[] dir)
public java.util.List<long[]> plotCourse(long[] osrc, long sradius, long[] otarget, long tradius, int maxTicks)
GalacticMap
plotCourse
in interface GalacticMap
osrc
- the source coordinatessradius
- the source object radiusotarget
- the target coordinatestradius
- the target object radiusmaxTicks
- maximum number of direction changes .. always send something gt 0public double getGravityForce(SpaceObject S, SpaceObject cO)
GalacticMap
getGravityForce
in interface GalacticMap
S
- the object being pulledcO
- the object pullingpublic boolean sendSpaceEmissionEvent(SpaceObject srcP, Environmental tool, int emissionType, java.lang.String msgStr)
GalacticMap
sendSpaceEmissionEvent
in interface GalacticMap
srcP
- the generator of the event/the centertool
- the means by which the event was generatedemissionType
- the CMMsg type of the eventmsgStr
- a description of the sensory messagepublic boolean sendSpaceEmissionEvent(SpaceObject srcP, Environmental tool, long range, int emissionType, java.lang.String msgStr)
GalacticMap
sendSpaceEmissionEvent
in interface GalacticMap
srcP
- the generator of the event/the centertool
- the means by which the event was generatedrange
- the range at which the emission can be detectedemissionType
- the CMMsg type of the eventmsgStr
- a description of the sensory messageprotected void swapTargetTool(CMMsg msg)
public void runSpace()
public boolean activate()
CMLibrary
activate
in interface CMLibrary
activate
in class StdLibrary
CMLibrary.shutdown()
public boolean tick(Tickable ticking, int tickID)
Tickable
tick
in interface Tickable
tick
in class StdLibrary
ticking
- a reference to this Tickable objecttickID
- the TICKID_ constant describing this periodic call, as defined in TickableTickable
,
ServiceEngine
,
TickableGroup
public boolean shutdown()
CMLibrary
shutdown
in interface CMLibrary
shutdown
in class StdLibrary
CMLibrary.activate()