CoffeeDark
public interface GalacticMap extends CMLibrary
idConverter
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.
|
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.
|
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.
|
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.
|
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.
|
ShipDirectional.ShipDir[] |
getCurrentBattleCoveredDirections(ShipDirectional comp) |
Given a ship war component, returns the directions in which it is
currently covering.
|
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[] coordinates) |
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[] curPosition,
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.
|
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[] coordinates) |
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.
|
boolean |
isObjectInSpace(SpaceObject O) |
Returns whether the given object is actually in
the galactic map cache at the moment -- it could
be landed somewhere.
|
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.
|
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.
|
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.
|
java.util.Enumeration<Area> |
spaceAreas() |
Returns an enumeration of all Areas that are also
SpaceObjects, typically planets.
|
activate, getServiceClient, L, propertiesLoaded, shutdown
copyOf, ID, initializeClass, name, newInstance
java.util.Enumeration<Area> spaceAreas()
int numSpaceObjects()
java.util.Map<java.lang.String,BoundedObject.BoundedCube> getSectorMap()
boolean isObjectInSpace(SpaceObject O)
O
- the space object to look fornumSpaceObjects()
,
isObjectInSpace(SpaceObject)
,
delObjectInSpace(SpaceObject)
,
addObjectToSpace(SpaceObject, long[])
,
addObjectToSpace(SpaceObject)
,
findSpaceObject(String, boolean)
void delObjectInSpace(SpaceObject O)
O
- the object to removenumSpaceObjects()
,
isObjectInSpace(SpaceObject)
,
delObjectInSpace(SpaceObject)
,
addObjectToSpace(SpaceObject, long[])
,
addObjectToSpace(SpaceObject)
,
findSpaceObject(String, boolean)
void addObjectToSpace(SpaceObject O, long[] coords)
O
- the SpaceObject to addcoords
- the coordinates to add it atnumSpaceObjects()
,
isObjectInSpace(SpaceObject)
,
delObjectInSpace(SpaceObject)
,
addObjectToSpace(SpaceObject, long[])
,
addObjectToSpace(SpaceObject)
,
findSpaceObject(String, boolean)
void addObjectToSpace(SpaceObject O)
O
- the object to put in spacenumSpaceObjects()
,
isObjectInSpace(SpaceObject)
,
delObjectInSpace(SpaceObject)
,
addObjectToSpace(SpaceObject, long[])
,
addObjectToSpace(SpaceObject)
,
findSpaceObject(String, boolean)
long getDistanceFrom(SpaceObject O1, SpaceObject O2)
O1
- the first space objectO2
- the second space objectgetDistanceFrom(long[], long[])
,
getDistanceFrom(SpaceObject, SpaceObject)
,
getMinDistanceFrom(long[], long[], long[])
long getDistanceFrom(long[] coord1, long[] coord2)
coord1
- first galactic coordscoord2
- second galactic coordsgetDistanceFrom(long[], long[])
,
getDistanceFrom(SpaceObject, SpaceObject)
,
getMinDistanceFrom(long[], long[], long[])
double getMinDistanceFrom(long[] prevPos, long[] curPosition, long[] objPos)
prevPos
- previous position on galactic chartcurPosition
- current position on galactic chartobjPos
- the object position curious about minimum distance togetDistanceFrom(long[], long[])
,
getDistanceFrom(SpaceObject, SpaceObject)
,
getMinDistanceFrom(long[], long[], long[])
double getAngleDelta(double[] fromAngle, double[] toAngle)
fromAngle
- the first angletoAngle
- the second anglegetAngleDiff(double[], double[])
double[] getMiddleAngle(double[] angle1, double[] angle2)
angle1
- the first angleangle2
- the second angledouble[] getOffsetAngle(double[] correctAngle, double[] wrongAngle)
correctAngle
- the base anglewrongAngle
- the wrong angledouble[] getAngleDiff(double[] fromAngle, double[] toAngle)
fromAngle
- the first angletoAngle
- the second anglegetAngleDelta(double[], double[])
void applyAngleDiff(double[] angle, double[] delta)
angle
- the angle to modifydelta
- the deltadouble[] getDirection(SpaceObject fromObj, SpaceObject toObj)
fromObj
- the first SpaceObjecttoObj
- the second SpaceObjectgetDirection(long[], long[])
,
getDirection(SpaceObject, SpaceObject)
,
getDirectionFromDir(double[], double, double[])
,
getOppositeDir(double[])
double[] getDirection(long[] fromCoords, long[] toCoords)
fromCoords
- the first coordinatestoCoords
- the second coordinatesgetDirection(long[], long[])
,
getDirection(SpaceObject, SpaceObject)
,
getDirectionFromDir(double[], double, double[])
,
getOppositeDir(double[])
ShipDirectional.ShipDir getDirectionFromDir(double[] facing, double roll, double[] direction)
facing
- the direction of facingroll
- the roll angledirection
- the direction to the other objectShipDirectional.ShipDir
,
getDirection(long[], long[])
,
getDirection(SpaceObject, SpaceObject)
,
getDirectionFromDir(double[], double, double[])
,
getOppositeDir(double[])
,
getAbsoluteDirectionalFromDir(double[])
ShipDirectional.ShipDir getAbsoluteDirectionalFromDir(double[] direction)
direction
- the direction to the other objectShipDirectional.ShipDir
,
getDirection(long[], long[])
,
getDirection(SpaceObject, SpaceObject)
,
getDirectionFromDir(double[], double, double[])
,
getOppositeDir(double[])
,
getDirectionFromDir(double[], double, double[])
double[] getOppositeDir(double[] dir)
dir
- the directiongetDirection(long[], long[])
,
getDirection(SpaceObject, SpaceObject)
,
getDirectionFromDir(double[], double, double[])
,
getOppositeDir(double[])
double[][] getPerpendicularAngles(double[] angle)
angle
- the angle from originlong[][] getPerpendicularPoints(long[] origin, double[] angle, long distance)
origin
- the origin pointsangle
- the angle from origindistance
- the distance from origin of the points to returngetPerpendicularAngles(double[])
void changeDirection(double[] dir, double delta0, double delta1)
dir
- the current direction to changedelta0
- the port/starboard deltadelta1
- the ventral/dorsel deltavoid changeDirection(double[] dir, double[] delta)
dir
- the current direction to changedelta
- the delta to change it by, + or -long getRelativeSpeed(SpaceObject O1, SpaceObject O2)
O1
- the first Space ObjectO2
- the second Space Objectvoid accelSpaceObject(SpaceObject O, double[] accelDirection, double newAcceleration)
O
- the space object to modifyaccelDirection
- the acceleration directionnewAcceleration
- the acceleration amountaccelSpaceObject(double[], double, double[], double)
double accelSpaceObject(double[] curDirection, double curSpeed, double[] accelDirection, double newAcceleration)
curDirection
- the current direction, *AND* the new directioncurSpeed
- the current speedaccelDirection
- the direction of accelerationnewAcceleration
- the amount of accelerationaccelSpaceObject(double[], double, double[], double)
long[] getLocation(long[] oldLocation, double[] direction, long distance)
oldLocation
- the previous locationdirection
- the direction of traveldistance
- the distance of travelmoveSpaceObject(SpaceObject)
,
moveSpaceObject(SpaceObject, long[])
,
moveSpaceObject(long[], double[], long)
void moveSpaceObject(SpaceObject O)
O
- the SpaceObject to movemoveSpaceObject(SpaceObject, long[])
,
moveSpaceObject(long[], double[], long)
,
getLocation(long[], double[], long)
void moveSpaceObject(SpaceObject O, long[] coords)
O
- the space object that is movingcoords
- the coordinates to modify based on speed/dir of the objectmoveSpaceObject(SpaceObject)
,
moveSpaceObject(long[], double[], long)
,
getLocation(long[], double[], long)
long[] moveSpaceObject(long[] coordinates, double[] direction, long speed)
coordinates
- the galactic coordinatesdirection
- the direction anglespeed
- the speedmoveSpaceObject(SpaceObject)
,
moveSpaceObject(SpaceObject, long[])
,
getLocation(long[], double[], long)
Pair<double[],java.lang.Long> calculateIntercept(SpaceObject chaserO, SpaceObject runnerO, long maxChaserSpeed, int maxTicks)
chaserO
- the chasing objectrunnerO
- the running objectmaxChaserSpeed
- the max chasing speedmaxTicks
- the maximum number of movementscanMaybeIntercept(SpaceObject, SpaceObject, int, double)
boolean canMaybeIntercept(SpaceObject chaserO, SpaceObject runnerO, int maxTicks, double maxSpeed)
chaserO
- the chasing objectrunnerO
- the running objectmaxTicks
- the maximum number of movementsmaxSpeed
- the max speed of the chasercalculateIntercept(SpaceObject, SpaceObject, long, int)
java.util.Enumeration<SpaceObject> getSpaceObjects()
getSpaceObjectEntries()
,
getSpaceObjectsWithin(SpaceObject, long, long)
,
getSpaceObjectsByCenterpointWithin(long[], long, long)
,
findSpaceObject(String, boolean)
,
getSpaceObject(CMObject, boolean)
java.util.Enumeration<java.util.Map.Entry<SpaceObject,java.util.List<java.lang.ref.WeakReference<TrackingVector<SpaceObject>>>>> getSpaceObjectEntries()
getSpaceObjects()
,
getSpaceObjectsWithin(SpaceObject, long, long)
,
getSpaceObjectsByCenterpointWithin(long[], long, long)
,
findSpaceObject(String, boolean)
,
getSpaceObject(CMObject, boolean)
,
getSpaceObjectsInBound(BoundedCube)
java.util.List<SpaceObject> getSpaceObjectsWithin(SpaceObject ofObj, long minDistance, long maxDistance)
ofObj
- the space object to use as a center pointminDistance
- the minimum distance to returnmaxDistance
- the maximum distance to returngetSpaceObjects()
,
getSpaceObjectEntries()
,
getSpaceObjectsByCenterpointWithin(long[], long, long)
,
findSpaceObject(String, boolean)
,
getSpaceObject(CMObject, boolean)
,
getSpaceObjectsInBound(BoundedCube)
java.util.List<SpaceObject> getSpaceObjectsInBound(BoundedObject.BoundedCube cube)
cube
- the cube to look withingetSpaceObjects()
,
getSpaceObjectEntries()
,
getSpaceObjectsByCenterpointWithin(long[], long, long)
,
findSpaceObject(String, boolean)
,
getSpaceObject(CMObject, boolean)
java.util.List<SpaceObject> getSpaceObjectsByCenterpointWithin(long[] centerCoordinates, long minDistance, long maxDistance)
centerCoordinates
- the full galactic coordinates of the center pointminDistance
- the minimum distance to returnmaxDistance
- the maximum distance to returngetSpaceObjects()
,
getSpaceObjectEntries()
,
getSpaceObjectsWithin(SpaceObject, long, long)
,
findSpaceObject(String, boolean)
,
getSpaceObject(CMObject, boolean)
,
getSpaceObjectsInBound(BoundedCube)
SpaceObject getSpaceObject(CMObject o, boolean ignoreMobs)
o
- the game object, of almost any sort (item, area, room, mob)ignoreMobs
- true to return null on mobs, false otherwisegetSpaceObjects()
,
getSpaceObjectEntries()
,
getSpaceObjectsWithin(SpaceObject, long, long)
,
getSpaceObjectsByCenterpointWithin(long[], long, long)
,
findSpaceObject(String, boolean)
,
getSpaceObjectsInBound(BoundedCube)
SpaceObject findSpaceObject(java.lang.String s, boolean exactOnly)
s
- the search stringexactOnly
- true to only match full terms, false for partial matchesgetSpaceObjects()
,
getSpaceObjectEntries()
,
getSpaceObjectsWithin(SpaceObject, long, long)
,
getSpaceObjectsByCenterpointWithin(long[], long, long)
,
getSpaceObject(CMObject, boolean)
,
getSpaceObjectsInBound(BoundedCube)
java.lang.String getSectorName(long[] coordinates)
coordinates
- the space coordinatesgetInSectorCoords(long[])
long[] getInSectorCoords(long[] coordinates)
coordinates
- the space coordinatesgetSectorName(long[])
java.util.List<LocationRoom> getLandingPoints(SpaceObject ship, Environmental O)
ship
- the ship looking for a landing spotO
- an area, room, boardable, whateverdouble getGravityForce(SpaceObject S, SpaceObject cO)
S
- the object being pulledcO
- the object pullingShipDirectional.ShipDir[] getCurrentBattleCoveredDirections(ShipDirectional comp)
comp
- the war componentboolean sendSpaceEmissionEvent(SpaceObject srcP, Environmental tool, int emissionType, java.lang.String msgStr)
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 messageboolean sendSpaceEmissionEvent(SpaceObject srcP, Environmental tool, long range, int emissionType, java.lang.String msgStr)
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 messagejava.util.List<long[]> plotCourse(long[] osrc, long sradius, long[] otarget, long tradius, int maxTicks)
osrc
- the source coordinatessradius
- the source object radiusotarget
- the target coordinatestradius
- the target object radiusmaxTicks
- maximum number of direction changes .. always send something gt 0