|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmegamek.common.util.BoardUtilities
public class BoardUtilities
| Nested Class Summary | |
|---|---|
protected static class |
BoardUtilities.Point
|
| Constructor Summary | |
|---|---|
BoardUtilities()
|
|
| Method Summary | |
|---|---|
protected static void |
addCliffs(IBoard board,
int modifier)
|
static void |
addCraters(IBoard board,
int minRadius,
int maxRadius,
int minCraters,
int maxCraters)
add a crater to the board |
static void |
addRiver(IBoard board,
java.util.HashMap<IHex,BoardUtilities.Point> reverseHex)
Adds an River to the map (if the map is at least 5x5 hexes big). |
static void |
addWeatherConditions(IBoard board,
int weatherCond,
int windCond)
|
static IBoard |
combine(int width,
int height,
int sheetWidth,
int sheetHeight,
IBoard[] boards,
int medium)
Combines one or more boards into one huge megaboard! |
protected static void |
copyBoardInto(IHex[] dest,
int destWidth,
int x,
int y,
IBoard copied)
Copies the data of another board into given array of Hexes, offset by the specified x and y. |
static int |
craterProfile(double x,
int scale)
The profile of a crater: interior is exp-function, exterior cos function. |
protected static void |
cutSteps(int hilliness,
int width,
int height,
int[][] elevationMap)
one of the landscape generation algorithms |
protected static void |
diagMid(BoardUtilities.Point p,
int d1,
int d2,
int delta,
int size,
int[][] elevationMap)
calculates the diagonal middlepoints with new values |
static void |
flip(IBoard board,
boolean horiz,
boolean vert)
Flips the board around the vertical axis (North-for-South) and/or the horizontal axis (East-for-West). |
static void |
generateElevation(int hilliness,
int width,
int height,
int range,
int invertProb,
int invertNegative,
int[][] elevationMap,
int algorithm)
Generates the elevations |
static void |
generateMountain(IBoard board,
int width,
Coords centre,
int height,
int capStyle)
|
static IBoard |
generateRandom(MapSettings mapSettings)
Generates a Random Board |
protected static void |
markRect(int x1,
int x2,
int inc,
int[][] elevationMap,
int height)
Helper function for the map generator increased a heightmap my a given value |
protected static void |
markSides(BoardUtilities.Point p1,
BoardUtilities.Point p2,
int upperInc,
int lowerInc,
int[][] elevationMap,
int height)
Helper function for map generator inreases all of one side and decreased on other side |
protected static int |
middleValue(int a,
int b,
int c,
int delta)
calculates the arithmetic medium of 3 values and add random value in range of delta. |
protected static int |
middleValue(int a,
int b,
int c,
int d,
int delta)
calculates the arithmetic medium of 4 values and add random value in range of delta. |
protected static void |
midPoint(int hilliness,
int width,
int height,
int[][] elevationMap)
midpoint algorithm for landscape generartion |
protected static void |
midPointStep(double fracdim,
int size,
int delta,
int[][] elevationMap,
int step,
boolean newBorder)
Helper function for landscape generation |
protected static void |
placeSomeTerrain(IBoard board,
int terrainType,
int probMore,
int minHexes,
int maxHexes,
java.util.HashMap<IHex,BoardUtilities.Point> reverseHex,
boolean exclusive)
Places randomly some connected Woods. |
protected static void |
postProcessDeepFreeze(IHex[] hexSet,
int modifier)
Converts water hexes to ice hexes. |
protected static void |
postProcessDrought(IHex[] hexSet,
int modifier)
Dries up all bodies of water by 1-3 levels. dried up water becomes swamp then rough |
protected static void |
postProcessFlood(IHex[] hexSet,
int modifier)
Flood negative hex levels Shoreline / salt marshes effect Works best with more elevation |
protected static void |
postProcessForestFire(IHex[] hexSet,
int modifier)
Burning woods, with chance to be burnt down already |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BoardUtilities()
| Method Detail |
|---|
public static IBoard combine(int width,
int height,
int sheetWidth,
int sheetHeight,
IBoard[] boards,
int medium)
width - the width of each individual board, before the combineheight - the height of each individual board, before the combinesheetWidth - how many sheets wide the combined map issheetHeight - how many sheets tall the combined map isboards - an array of the boards to be combined
protected static void copyBoardInto(IHex[] dest,
int destWidth,
int x,
int y,
IBoard copied)
public static IBoard generateRandom(MapSettings mapSettings)
width - The width of the generated Board.height - The height of the gernerated Board.steps - how often the iterative method should be repeated
protected static void placeSomeTerrain(IBoard board,
int terrainType,
int probMore,
int minHexes,
int maxHexes,
java.util.HashMap<IHex,BoardUtilities.Point> reverseHex,
boolean exclusive)
probHeavy - The probability that a wood is a heavy wood (in %).maxWoods - Maximum Number of Woods placed.
public static void addCraters(IBoard board,
int minRadius,
int maxRadius,
int minCraters,
int maxCraters)
public static int craterProfile(double x,
int scale)
x - The x value of the function. range 0..1. 0=center of crater.
1=border of outer wall.scale - Apply this scale before returning the result (recommend
instead of afterwards scale, cause this way the intern
floating values are scaled, instead of int result).
public static void addRiver(IBoard board,
java.util.HashMap<IHex,BoardUtilities.Point> reverseHex)
protected static void postProcessFlood(IHex[] hexSet,
int modifier)
protected static void postProcessDeepFreeze(IHex[] hexSet,
int modifier)
protected static void postProcessForestFire(IHex[] hexSet,
int modifier)
protected static void postProcessDrought(IHex[] hexSet,
int modifier)
protected static void addCliffs(IBoard board,
int modifier)
public static void addWeatherConditions(IBoard board,
int weatherCond,
int windCond)
public static void generateElevation(int hilliness,
int width,
int height,
int range,
int invertProb,
int invertNegative,
int[][] elevationMap,
int algorithm)
hilliness - The Hillinesswidth - The Width of the map.height - The Height of the map.range - Max difference betweenn highest and lowest level.invertProb - Probability for the invertion of the map (0..100)invertNegate - If 1, invert negative hexes, else do nothingelevationMap - here is the result stored
public static void generateMountain(IBoard board,
int width,
Coords centre,
int height,
int capStyle)
public static void flip(IBoard board,
boolean horiz,
boolean vert)
horiz - - a boolean value that, if true,
indicates that the board is being flipped North-for-South.vert - - a boolean value that, if true,
indicates that the board is being flipped East-for-West.
protected static void cutSteps(int hilliness,
int width,
int height,
int[][] elevationMap)
protected static void markRect(int x1,
int x2,
int inc,
int[][] elevationMap,
int height)
protected static void markSides(BoardUtilities.Point p1,
BoardUtilities.Point p2,
int upperInc,
int lowerInc,
int[][] elevationMap,
int height)
protected static void midPoint(int hilliness,
int width,
int height,
int[][] elevationMap)
protected static void midPointStep(double fracdim,
int size,
int delta,
int[][] elevationMap,
int step,
boolean newBorder)
protected static void diagMid(BoardUtilities.Point p,
int d1,
int d2,
int delta,
int size,
int[][] elevationMap)
p - Starting point.
protected static int middleValue(int a,
int b,
int c,
int delta)
protected static int middleValue(int a,
int b,
int c,
int d,
int delta)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||