com.springrts.ai.oo
Class Map

java.lang.Object
  extended by com.springrts.ai.oo.Map
All Implemented Interfaces:
Comparable<Map>

public class Map
extends Object
implements Comparable<Map>


Method Summary
 int compareTo(Map other)
           
 boolean equals(Object otherObject)
           
 AIFloat3 findClosestBuildSite(UnitDef c_unitDefId, AIFloat3 pos, float searchRadius, int minDist, int facing)
          Returns the closest position from a given position that a building can be built at.
 int getChecksum()
           
 float getCurWind()
           
 float getElevationAt(float x, float z)
          Gets the elevation of the map at position (x, z)
 float getExtractorRadius(Resource c_resourceId)
          Returns extraction radius for resource extractors
 float getGravity()
           
 int getHeight()
          Returns the maps height in full resolution
 List<Float> getHeightMap()
          Returns the height for the center of the squares.
 List<Short> getJammerMap()
          the radar jammer map A square with value 0 means you do not have radar jamming coverage.
 List<Line> getLines(boolean includeAllies)
          Returns all lines drawn with this AIs team color, and additionally the ones drawn with allied team colors, if includeAllies is true.
 List<Short> getLosMap()
           
 float getMaxHeight()
           
 float getMaxResource(Resource c_resourceId)
          Returns what value 255 in the resource map is worth
 float getMaxWind()
           
 float getMinHeight()
           
 float getMinWind()
           
 AIFloat3 getMousePos()
           
 String getName()
           
 List<Point> getPoints(boolean includeAllies)
          Returns all points drawn with this AIs team color, and additionally the ones drawn with allied team colors, if includeAllies is true.
 List<Short> getRadarMap()
          the radar map A square with value 0 means you do not have radar coverage on it.
 List<Byte> getResourceMapRaw(Resource c_resourceId)
          resource maps This map shows the resource density on the map.
 List<AIFloat3> getResourceMapSpotsPositions(Resource c_resourceId)
          Returns positions indicating where to place resource extractors on the map.
 List<Float> getSlopeMap()
          the slope map The values are 1 minus the y-component of the (average) facenormal of the square.
 AIFloat3 getStartPos()
           
 float getTidalStrength()
           
 int getWidth()
          Returns the maps width in full resolution
 int hashCode()
           
 boolean isPosInCamera(AIFloat3 pos, float radius)
           
 boolean isPossibleToBuildAt(UnitDef c_unitDefId, AIFloat3 pos, int facing)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

compareTo

public int compareTo(Map other)
Specified by:
compareTo in interface Comparable<Map>

equals

public boolean equals(Object otherObject)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

getChecksum

public int getChecksum()

getStartPos

public AIFloat3 getStartPos()

getMousePos

public AIFloat3 getMousePos()

isPosInCamera

public boolean isPosInCamera(AIFloat3 pos,
                             float radius)

getWidth

public int getWidth()
Returns the maps width in full resolution


getHeight

public int getHeight()
Returns the maps height in full resolution


getHeightMap

public List<Float> getHeightMap()
Returns the height for the center of the squares. This differs slightly from the drawn map, since that one uses the height at the corners. - do NOT modify or delete the height-map (native code relevant only) - index 0 is top left - each data position is 8*8 in size - the value for the full resolution position (x, z) is at index (x/8 * width + z/8) - the last value, bottom right, is at index (width/8 * height/8 - 1)


getMinHeight

public float getMinHeight()

getMaxHeight

public float getMaxHeight()

getSlopeMap

public List<Float> getSlopeMap()
the slope map The values are 1 minus the y-component of the (average) facenormal of the square. - do NOT modify or delete the height-map (native code relevant only) - index 0 is top left - each data position is 2*2 in size - the value for the full resolution position (x, z) is at index (x/2 * width + z/2) - the last value, bottom right, is at index (width/2 * height/2 - 1)


getLosMap

public List<Short> getLosMap()

getRadarMap

public List<Short> getRadarMap()
the radar map A square with value 0 means you do not have radar coverage on it. - do NOT modify or delete the height-map (native code relevant only) - index 0 is top left - each data position is 8*8 in size - the value for the full resolution position (x, z) is at index (x/8 * width + z/8) - the last value, bottom right, is at index (width/8 * height/8 - 1)


getJammerMap

public List<Short> getJammerMap()
the radar jammer map A square with value 0 means you do not have radar jamming coverage. - do NOT modify or delete the height-map (native code relevant only) - index 0 is top left - each data position is 8*8 in size - the value for the full resolution position (x, z) is at index (x/8 * width + z/8) - the last value, bottom right, is at index (width/8 * height/8 - 1)


getResourceMapRaw

public List<Byte> getResourceMapRaw(Resource c_resourceId)
resource maps This map shows the resource density on the map. - do NOT modify or delete the height-map (native code relevant only) - index 0 is top left - each data position is 2*2 in size - the value for the full resolution position (x, z) is at index (x/2 * width + z/2) - the last value, bottom right, is at index (width/2 * height/2 - 1)


getResourceMapSpotsPositions

public List<AIFloat3> getResourceMapSpotsPositions(Resource c_resourceId)
Returns positions indicating where to place resource extractors on the map. Only the x and z values give the location of the spots, while the y values represents the actual amount of resource an extractor placed there can make. You should only compare the y values to each other, and not try to estimate effective output from spots.


getName

public String getName()

getElevationAt

public float getElevationAt(float x,
                            float z)
Gets the elevation of the map at position (x, z)


getMaxResource

public float getMaxResource(Resource c_resourceId)
Returns what value 255 in the resource map is worth


getExtractorRadius

public float getExtractorRadius(Resource c_resourceId)
Returns extraction radius for resource extractors


getMinWind

public float getMinWind()

getMaxWind

public float getMaxWind()

getCurWind

public float getCurWind()

getTidalStrength

public float getTidalStrength()

getGravity

public float getGravity()

isPossibleToBuildAt

public boolean isPossibleToBuildAt(UnitDef c_unitDefId,
                                   AIFloat3 pos,
                                   int facing)

findClosestBuildSite

public AIFloat3 findClosestBuildSite(UnitDef c_unitDefId,
                                     AIFloat3 pos,
                                     float searchRadius,
                                     int minDist,
                                     int facing)
Returns the closest position from a given position that a building can be built at.

Parameters:
minDist - the distance in squares that the building must keep to other buildings, to make it easier to keep free paths through a base

getPoints

public List<Point> getPoints(boolean includeAllies)
Returns all points drawn with this AIs team color, and additionally the ones drawn with allied team colors, if includeAllies is true.


getLines

public List<Line> getLines(boolean includeAllies)
Returns all lines drawn with this AIs team color, and additionally the ones drawn with allied team colors, if includeAllies is true.