MapParams.java
/*
* $RCSfile: MapParams.java,v $
* $Id: MapParams.java,v 1.6 1998/11/30 02:21:07 devnull Exp $
* by Lee Wilson, http://www.ad1440.net/~devnull
* Development started on 1998 10 01
* (c) Devnull Software, LLC. (http://www.devnullsoftware.com)
*/
package com.devnullsoftware.javaterrain;
import java.awt.*;
import java.rmi.*;
import java.util.*;
import javax.swing.*;
import com.devnullsoftware.config.*;
/**
World Parameters.
@author Lee Wilson
@version 1.0
*/
public class MapParams implements Configable {
//-------------------------------------------------------------------
// Global Constants
//
public static final byte WORLDSIZE_TINY = 0;
public static final byte WORLDSIZE_SMALL = 1;
public static final byte WORLDSIZE_NORMAL = 2;
public static final byte WORLDSIZE_HUGE = 3;
public static final String [] sWorldSizeStrings = {
"Tiny", "Small", "Normal", "Huge"
};
public static final short WORLDSIZE_DIM_TINY = 32;
public static final short WORLDSIZE_DIM_SMALL = 64;
public static final short WORLDSIZE_DIM_NORMAL = 128;
public static final short WORLDSIZE_DIM_HUGE = 256;
public static final byte MANALEVEL_NONE = 0;
public static final byte MANALEVEL_LOW = 1;
public static final byte MANALEVEL_NORMAL = 2;
public static final byte MANALEVEL_HIGH = 3;
public static final byte MANALEVEL_VERYHIGH = 4;
public static final String [] sManaLevelStrings = {
"None", "Low", "Normal", "High", "Very High"
};
//-------------------------------------------------------------------
// Instance Variables
//
// General
public Map pMap = null;
public String sName;
public int iDim = 32;
/**
Number of Seasons in a year for this world.
*/
public int iNumSeasons = 4;
public byte bMaxRange = 15;
public int TEMPSCALE = 10;
// Elevation
/**
the number of Iterations to use for initialization. Default 3;
*/
public int iIterations = 2;
/**
The roughness parameter. Default 0.7;
*/
public float fRoughness = 0.7f;
public float fPercentDeepOcean;
public float fPercentOcean = 0.7f ;
public float fPercentHills = 0.96f;
public float fPercentMountains = 0.985f;
public float fPercentImpassableMountains = 0.995f;
public int iMinInlandSeaSize = 5;
// Temperature
/**
This is the tilt of the planet with respect to
its plane of orbit, in degrees. Smaller numbers produce less
seasonality; numbers above 45 violate some of the assumptions
of the models used. Default is 23.0
*/
public double dAxialTilt = 23.0;
/**
The Orbital Eccentricity of the planet's orbit; this parameter affects
seasonality as well. Numbers above 0.5 are probably unrealistic.
Default 0.0.
*/
public double dOrbitalEccentricity = 0.0;
/**
This parameter describes the phase offset of the dOrbitalEccentricity with
respect to the dAxialTilt, in radians. You can produce climates with
complicated seasonality by varying this. Default 0.0.
*/
public double dEccentricityPhase = 0.0;
/**
The basic temperature for land squares (in Kelvins), assuming no
dAxialTilt, dOrbitalEccentricity, or nearby ocean. Default is 275.0.
*/
public double dBaseLandTemp = 275.0;
/**
The amount by which land temperatures should vary from north pole to
equator. Land temperature, ignoring ocean effects, varies from
dBaseLandTemp - dLandTempVariance/2 at the poles to
dBaseLandTemp + dLandTempVariance/2 at the equator.
Default 45.0.
*/
public double dLandTempVariance = 45.0;
/**
The fraction of the dAxialTilt parameter that should be applied to
temperature adjustment for land. Typically, land temperatures vary
more from season to season than the ocean temperatures do, so
dLandTempTilt should be higher than dOceanTempTilt. Default 1.0.
*/
public double dLandTempTilt = 1.0;
/**
One equation governs the effect of land on ocean temperatures and vice
versa. The equation involves dLandSmooth, dLandDiv,
dOceanSmooth and dOceanDiv. Given the land and sea temperatures, and
the number of land squares in a 11 x 5 box around the square, the final
temperature is a weighted sum of the two temperatures. The weights
are related to dLandSmooth and dOceanSmooth, and the importance of
nearby land is diminished by increasing dLandDiv or dOceanDiv.
Default 0.6.
*/
public double dLandSmooth = 0.6f;
/**
See above. Default 180.0.
*/
public double dLandDiv = 180.0;
/**
Same as dBaseLandTemp, only for the ocean. Default 275.0.
*/
public double dBaseOceanTemp = 275.0;
/**
Same as dLandTempVariance, only for the ocean. Default 30.0.
*/
public double dOceanTempVariance = 30.0;
/**
See dLandTempTilt. Default 0.2.
*/
public double dOceanTempTilt = 0.2f;
/**
See dLandSmooth. Default 0.2.
*/
public double dOceanSmooth = 0.2f;
/**
See dLandSmooth. Default 250.0.
*/
public double dOceanDiv = 250.0;
// Pressure
/**
Ocean pressure zones essentially ignore land masses whose radius is equal
to or less than this number, like islands. Default 1.
*/
public byte OLTHRESH = 1;
/**
Ocean pressure zones must be at least this many squares away from the
nearest (non-ignored) land. Default 5.
*/
public byte OOTHRESH = 5;
/**
If the unscaled temperature of an ocean square is greater than OLMIN
and less than OLMAX, then that square is a low pressure zone.
Default 40.
*/
public byte OLMIN = 40;
/**
See above. Default 65.
*/
public byte OLMAX = 65;
/**
If the unscaled temperature of an ocean square is greater than OHMIN
and less than OHMAX, then that square is a high pressure zone.
Default 130.
*/
public short OHMIN = 130;
/**
See above. Default 180.
*/
public short OHMAX = 180;
/**
Land pressure zones essentially ignore ocean bodies whose radius is less
than or equal to this number, like lakes. Default 3.
*/
public short LOTHRESH = 3;
/**
Land pressure zones must be at least this many squares away from the
nearest (non-ignored) ocean.
Default 7.
*/
public short LLTHRESH = 7;
/**
If the unscaled temperature of a land square is greater than LLMIN and
less than LLMAX, then that square is a low pressure zone.
Default 220.
*/
public short LLMIN = 220;
/**
See above. Default 255.
*/
public short LLMAX = 255;
/**
If the unscaled temperature of a land square is greater than LHMIN and
less than LHMAX, then that square is a high pressure zone. Default 0.
*/
public byte LHMIN = 0;
/**
See above. Default 20.
*/
public byte LHMAX = 20;
// Wind
public short iMaxPressure = 255;
/**
Winds are determined from pressure; a smooth pressure map ranging from
0..255 is built by interpolating between highs and lows. Wind lines are
contour lines on this map, and BARSEP indicates the pressure difference
between lines on the map. Default 16.
*/
public byte BARSEP = 16;
// Rainfall
/**
Fetch is the term that describes how many squares a given wind line
travels over water. A high fetch indicates a moist wind. This number
is the maximum depth for the tree walking algorithm which finds fetch;
the effect of wind in one square can travel at most this number of squares
before stopping. Default 5.
*/
public byte MAXFETCH = 5;
/**
This is the base amount of rainfall in each square.
Default 32.
*/
public byte RAINCONST = 32;
/**
This is the amount by which rainfall is increased in every land or
mountain square; that is, rainfall goes down.
Default 10.
*/
public byte LANDEL = 10;
/**
For each unit of fetch which is stopped by a mountain, rainfall in the
mountain square increases by this amount.
Default 32.
*/
public byte MOUNTDEL = 32;
/**
The amount of rainfall in a square is increased by this number for each
unit of fetch in the square.
Default 4.
*/
public byte FETCHDEL = 4;
/**
The amount of rainfall in a square is increased by this amount if the
square is on the heat equator.
Default 32.
*/
public byte HEQDEL = 32;
/**
The amount of rainfall in a square is increased by this amount if the
square is next to a square on the heat equator.
Default 24.
*/
public byte NRHEQDEL = 24;
/**
The amount of rainfall in a square is increased by this amount if the
square is on the "flank" of a circular wind pattern. This happens when
the wind blows south. Default -24.
*/
public byte FLANKDEL = -24;
/**
The amount of rainfall in a square is increased by this amount for each
adjacent square which is on a "flank".
Default 3.
*/
public byte NRFDEL = 3;
// Climate
/**
If an ocean square is below this temperature (measured in deg Kelvin) all
year round, then the ocean square is icebergs.
Default 263.
*/
public short ICEBERGK = 263;
/**
The climate array found in climate.c/climkey is 4 x 5; the first index
is based on average annual temperature. The temperature is relative, based
on the range 0..255; this vector determines the cutoff points.
For example, with the default vector, a scaled temperature of 20
falls into the first "bin" and 121 falls into the fourth.
Default is {0,40,90,120}.
*/
public short [] TEMPCUT = {
// 0,40,90,120
0,65,100,140
};
/**
The second index of the climate array is based on average annual rainfall,
scaled into the range 0..255. This vector determines the cutoff points.
For example, rainfall of 35 falls into the first "bin".
Default is {40,60,110,160,180}.
*/
public short [] RAINCUT = {
// 40,60,110,160,180
37, 58, 85, 150, 170
};
/**
These are the cutoffs for elevation in Elevation-View
*/
public float [] ELEVATIONCUT = {
0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f
};
/**
This is the amount, in degrees Farenheit, by which temperature in the
mountains is decreased before the climate lookup is performed.
Default 20.
*/
public byte MTDELTA = 20;
// Terrain Images
public String [] sTerrainImageLocation = {
"img/NoType.gif",
"img/DeepOcean.gif",
"img/Ocean.gif",
"img/Mountains.gif",
"img/ImpassableMountains.gif",
"img/Volcano.gif",
"img/Ice.gif",
"img/Tundra.gif",
"img/Steppe.gif",
"img/Prairie.gif",
"img/Savannah.gif",
"img/Forest.gif",
"img/Jungle.gif",
"img/Swamp.gif",
"img/Desert.gif"
};
public Image [] pTerrainImage = new Image [Hex.NUM_TERRAIN+1];
// Goodies
public LabelValue [][] pGoodieChance;
public float fGoodieChance = 0.1f;
//-------------------------------------------------------------------
// Constructors
//
MapParams () {
init();
}
private void init () {
sName = "Map 1";
pGoodieChance = new LabelValue [Hex.NUM_TERRAIN+1][];
pGoodieChance[Hex.TERRAIN_DESERT] = new LabelValue[3];
pGoodieChance[Hex.TERRAIN_DESERT][0]
= new LabelValue(""+Hex.GOODIE_GEMS,"66.7");
pGoodieChance[Hex.TERRAIN_DESERT][1]
= new LabelValue(""+Hex.GOODIE_QUARX,"33.3");
pGoodieChance[Hex.TERRAIN_DESERT][2]
= new LabelValue(""+Hex.GOODIE_CRYSX,"0.0");
pGoodieChance[Hex.TERRAIN_MOUNTAINS]
= new LabelValue[6];
pGoodieChance[Hex.TERRAIN_MOUNTAINS][0]
= new LabelValue(""+Hex.GOODIE_IRON,"33.3");
pGoodieChance[Hex.TERRAIN_MOUNTAINS][1]
= new LabelValue(""+Hex.GOODIE_COAL,"16.7");
pGoodieChance[Hex.TERRAIN_MOUNTAINS][2]
= new LabelValue(""+Hex.GOODIE_SILVER,"22.2");
pGoodieChance[Hex.TERRAIN_MOUNTAINS][3]
= new LabelValue(""+Hex.GOODIE_GOLD,"22.2");
pGoodieChance[Hex.TERRAIN_MOUNTAINS][4]
= new LabelValue(""+Hex.GOODIE_MITHRIL,"5.6");
pGoodieChance[Hex.TERRAIN_MOUNTAINS][5]
= new LabelValue(""+Hex.GOODIE_ADAMANTIUM,"0.0");
pGoodieChance[Hex.TERRAIN_IMPASSABLEMOUNTAINS]
= new LabelValue[6];
pGoodieChance[Hex.TERRAIN_IMPASSABLEMOUNTAINS][0]
= new LabelValue(""+Hex.GOODIE_IRON,"22.2");
pGoodieChance[Hex.TERRAIN_IMPASSABLEMOUNTAINS][1]
= new LabelValue(""+Hex.GOODIE_COAL,"27.7");
pGoodieChance[Hex.TERRAIN_IMPASSABLEMOUNTAINS][2]
= new LabelValue(""+Hex.GOODIE_SILVER,"16.7");
pGoodieChance[Hex.TERRAIN_IMPASSABLEMOUNTAINS][3]
= new LabelValue(""+Hex.GOODIE_GOLD,"16.7");
pGoodieChance[Hex.TERRAIN_IMPASSABLEMOUNTAINS][4]
= new LabelValue(""+Hex.GOODIE_MITHRIL,"16.7");
pGoodieChance[Hex.TERRAIN_IMPASSABLEMOUNTAINS][5]
= new LabelValue(""+Hex.GOODIE_ADAMANTIUM,"0.0");
pGoodieChance[Hex.TERRAIN_FOREST]
= new LabelValue[1];
pGoodieChance[Hex.TERRAIN_FOREST][0]
= new LabelValue(""+Hex.GOODIE_WILDGAME,"100.0");
pGoodieChance[Hex.TERRAIN_SWAMP]
= new LabelValue[1];
pGoodieChance[Hex.TERRAIN_SWAMP][0]
= new LabelValue(""+Hex.GOODIE_NIGHTSHADE,"100.0");
}
// --------------------------------------------------------------------------
// Configable Interface
//
public Vector getParams () {
Vector pParameters = new Vector(2+9);
Vector pTitles = new Vector ();
Vector pGeneral = new Vector ();
Vector pElevation = new Vector ();
Vector pTemperature = new Vector();
Vector pPressure = new Vector();
Vector pWind = new Vector();
Vector pRainfall = new Vector();
Vector pClimate = new Vector();
Vector pTerrainImages = new Vector();
Vector pGoodieChances = new Vector();
Vector pVector = null;
ConfigComponent cc;
JComboBox choice;
pTitles.addElement(new String("General"));
pTitles.addElement(new String("Elevation"));
pTitles.addElement(new String("Temperature"));
pTitles.addElement(new String("Pressure"));
pTitles.addElement(new String("Wind"));
pTitles.addElement(new String("Rainfall"));
pTitles.addElement(new String("Climate"));
pTitles.addElement(new String("Terrain Image Locations"));
pTitles.addElement(new String("Goodie Chances"));
pParameters.addElement (new Integer(8));
pParameters.addElement (pTitles);
try {
cc = new ConfigComponent("World Name",
ConfigComponent.TEXTFIELD,
new JTextField (sName, 30),
ConfigComponent.BOOLEAN,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"sName",
null);
pGeneral.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4.1");
try {
Thread.sleep (1000);
}
catch (InterruptedException ex) {
System.out.println("oop4.1.1");
}
}
try {
choice = new JComboBox ();
choice.setEditable(false);
choice.addItem("32");
choice.addItem("64");
choice.addItem("128");
choice.addItem("256");
choice.setSelectedItem(""+iDim);
cc = new ConfigComponent("World Dimensions",
ConfigComponent.CHOICE,
choice,
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"iDim",
null);
pGeneral.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4.2");
try {
Thread.sleep (1000);
}
catch (InterruptedException ex) {
System.out.println("oop4.2.1");
}
}
try {
cc = new ConfigComponent("Number of Seasons",
ConfigComponent.TEXTFIELD,
new JTextField (""+iNumSeasons, 2),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"iNumSeasons",
null);
pGeneral.addElement(cc);
pParameters.addElement(pGeneral);
}
catch (ClassNotFoundException e) {
System.out.println("oops4.3");
try {
Thread.sleep (1000);
}
catch (InterruptedException ex) {
System.out.println("oop4.3.1");
}
}
try {
cc = new ConfigComponent("Roughness",
ConfigComponent.TEXTFIELD,
new JTextField (""+fRoughness, 5),
ConfigComponent.FLOAT,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"fRoughness",
null);
pElevation.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4.4");
try {
Thread.sleep (1000);
}
catch (InterruptedException ex) {
System.out.println("oop4.4.1");
}
}
try {
cc = new ConfigComponent("Iterations",
ConfigComponent.TEXTFIELD,
new JTextField (""+iIterations, 2),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"iIterations",
null);
pElevation.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4.5");
try {
Thread.sleep (1000);
}
catch (InterruptedException ex) {
System.out.println("oop4.5.1");
}
}
try {
cc = new ConfigComponent("Percent Ocean",
ConfigComponent.TEXTFIELD,
new JTextField (""+fPercentOcean, 5),
ConfigComponent.FLOAT,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"fPercentOcean",
null);
pElevation.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4.6");
}
try {
cc = new ConfigComponent("Percent Hills",
ConfigComponent.TEXTFIELD,
new JTextField (""+fPercentHills, 5),
ConfigComponent.FLOAT,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"fPercentHills",
null);
pElevation.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4.7");
}
try {
cc = new ConfigComponent("Percent Mountains",
ConfigComponent.TEXTFIELD,
new JTextField (""+fPercentMountains, 5),
ConfigComponent.FLOAT,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"fPercentMountains",
null);
pElevation.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4.8");
}
try {
cc = new ConfigComponent("Percent ImpassableMountains",
ConfigComponent.TEXTFIELD,
new JTextField (""+fPercentImpassableMountains, 5),
ConfigComponent.FLOAT,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"fPercentImpassableMountains",
null);
pElevation.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4.9");
}
try {
cc = new ConfigComponent("Minimum Inland Sea Size (in Hexes)",
ConfigComponent.TEXTFIELD,
new JTextField (""+iMinInlandSeaSize, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"iMinInlandSeaSize",
null);
pElevation.addElement(cc);
pParameters.addElement(pElevation);
}
catch (ClassNotFoundException e) {
System.out.println("oops4.10");
}
try {
cc = new ConfigComponent("Axial Tilt",
ConfigComponent.TEXTFIELD,
new JTextField (""+dAxialTilt, 5),
ConfigComponent.FLOAT,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"dAxialTilt",
null);
pTemperature.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("Orbital Eccentricity",
ConfigComponent.TEXTFIELD,
new JTextField (""+dOrbitalEccentricity, 5),
ConfigComponent.FLOAT,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"dOrbitalEccentricity",
null);
pTemperature.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("Eccentricity Phase",
ConfigComponent.TEXTFIELD,
new JTextField (""+dEccentricityPhase, 5),
ConfigComponent.FLOAT,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"dEccentricityPhase",
null);
pTemperature.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("Base Land Temp",
ConfigComponent.TEXTFIELD,
new JTextField (""+dBaseLandTemp, 5),
ConfigComponent.FLOAT,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"dBaseLandTemp",
null);
pTemperature.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("Land Temp Variance",
ConfigComponent.TEXTFIELD,
new JTextField (""+dLandTempVariance, 5),
ConfigComponent.FLOAT,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"dLandTempVariance",
null);
pTemperature.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("Land Temp Tilt",
ConfigComponent.TEXTFIELD,
new JTextField (""+dLandTempTilt, 5),
ConfigComponent.FLOAT,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"dLandTempTilt",
null);
pTemperature.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("LandSmooth",
ConfigComponent.TEXTFIELD,
new JTextField (""+dLandSmooth, 5),
ConfigComponent.FLOAT,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"dLandSmooth",
null);
pTemperature.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("LandDiv",
ConfigComponent.TEXTFIELD,
new JTextField (""+dLandDiv, 5),
ConfigComponent.FLOAT,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"dLandDiv",
null);
pTemperature.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("Base Ocean Temp",
ConfigComponent.TEXTFIELD,
new JTextField (""+dBaseOceanTemp, 5),
ConfigComponent.FLOAT,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"dBaseOceanTemp",
null);
pTemperature.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("Ocean Temp Variance",
ConfigComponent.TEXTFIELD,
new JTextField (""+dOceanTempVariance, 5),
ConfigComponent.FLOAT,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"dOceanTempVariance",
null);
pTemperature.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("Ocean Temp Tilt",
ConfigComponent.TEXTFIELD,
new JTextField (""+dOceanTempTilt, 5),
ConfigComponent.FLOAT,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"dOceanTempTilt",
null);
pTemperature.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("OceanSmooth",
ConfigComponent.TEXTFIELD,
new JTextField (""+dOceanSmooth, 5),
ConfigComponent.FLOAT,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"dOceanSmooth",
null);
pTemperature.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("OceanDiv",
ConfigComponent.TEXTFIELD,
new JTextField (""+dOceanDiv, 5),
ConfigComponent.FLOAT,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"dOceanDiv",
null);
pTemperature.addElement(cc);
pParameters.addElement(pTemperature);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("OLTHRESH",
ConfigComponent.TEXTFIELD,
new JTextField (""+OLTHRESH, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"OLTHRESH",
null);
pPressure.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("OOTHRESH",
ConfigComponent.TEXTFIELD,
new JTextField (""+OOTHRESH, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"OOTHRESH",
null);
pPressure.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("OLMIN",
ConfigComponent.TEXTFIELD,
new JTextField (""+OLMIN, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"OLMIN",
null);
pPressure.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("OLMAX",
ConfigComponent.TEXTFIELD,
new JTextField (""+OLMAX, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"OLMAX",
null);
pPressure.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("OHMIN",
ConfigComponent.TEXTFIELD,
new JTextField (""+OHMIN, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"OHMIN",
null);
pPressure.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("OHMAX",
ConfigComponent.TEXTFIELD,
new JTextField (""+OHMAX, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"OHMAX",
null);
pPressure.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("LOTHRESH",
ConfigComponent.TEXTFIELD,
new JTextField (""+LOTHRESH, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"LOTHRESH",
null);
pPressure.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("LLTHRESH",
ConfigComponent.TEXTFIELD,
new JTextField (""+LLTHRESH, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"LLTHRESH",
null);
pPressure.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("LLMIN",
ConfigComponent.TEXTFIELD,
new JTextField (""+LLMIN, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"LLMIN",
null);
pPressure.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("LLMAX",
ConfigComponent.TEXTFIELD,
new JTextField (""+LLMAX, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"LLMAX",
null);
pPressure.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("LHMIN",
ConfigComponent.TEXTFIELD,
new JTextField (""+LHMIN, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"LHMIN",
null);
pPressure.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("LHMAX",
ConfigComponent.TEXTFIELD,
new JTextField (""+LHMAX, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"LHMAX",
null);
pPressure.addElement(cc);
pParameters.addElement(pPressure);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("BARSEP",
ConfigComponent.TEXTFIELD,
new JTextField (""+BARSEP, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"BARSEP",
null);
pWind.addElement(cc);
pParameters.addElement(pWind);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("MAXFETCH",
ConfigComponent.TEXTFIELD,
new JTextField (""+MAXFETCH, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"MAXFETCH",
null);
pRainfall.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("RAINCONST",
ConfigComponent.TEXTFIELD,
new JTextField (""+RAINCONST, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"RAINCONST",
null);
pRainfall.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("LANDEL",
ConfigComponent.TEXTFIELD,
new JTextField (""+LANDEL, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"LANDEL",
null);
pRainfall.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("MOUNTDEL",
ConfigComponent.TEXTFIELD,
new JTextField (""+MOUNTDEL, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"MOUNTDEL",
null);
pRainfall.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("FETCHDEL",
ConfigComponent.TEXTFIELD,
new JTextField (""+FETCHDEL, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"FETCHDEL",
null);
pRainfall.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("HEQDEL",
ConfigComponent.TEXTFIELD,
new JTextField (""+HEQDEL, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"HEQDEL",
null);
pRainfall.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("NRHEQDEL",
ConfigComponent.TEXTFIELD,
new JTextField (""+NRHEQDEL, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"NRHEQDEL",
null);
pRainfall.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("FLANKDEL",
ConfigComponent.TEXTFIELD,
new JTextField (""+FLANKDEL, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"FLANKDEL",
null);
pRainfall.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("NRFDEL",
ConfigComponent.TEXTFIELD,
new JTextField (""+NRFDEL, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"NRFDEL",
null);
pRainfall.addElement(cc);
pParameters.addElement(pRainfall);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("ICEBERGK",
ConfigComponent.TEXTFIELD,
new JTextField (""+ICEBERGK, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"ICEBERGK",
null);
pClimate.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("MTDELTA",
ConfigComponent.TEXTFIELD,
new JTextField (""+MTDELTA, 5),
ConfigComponent.INTEGER,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"MTDELTA",
null);
pClimate.addElement(cc);
pParameters.addElement(pClimate);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(1);
pVector.add(new Integer(0));
cc = new ConfigComponent("NoType Image Location",
ConfigComponent.TEXTFIELD,
new JTextField (sTerrainImageLocation[0],
40),
ConfigComponent.STRING,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"sTerrainImageLocation",
pVector);
pTerrainImages.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(1);
pVector.add(new Integer(1));
cc = new ConfigComponent("DeepOcean Image Location",
ConfigComponent.TEXTFIELD,
new JTextField (sTerrainImageLocation[1],
40),
ConfigComponent.STRING,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"sTerrainImageLocation",
pVector);
pTerrainImages.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(1);
pVector.add(new Integer(2));
cc = new ConfigComponent("Ocean Image Location",
ConfigComponent.TEXTFIELD,
new JTextField (sTerrainImageLocation[2],
40),
ConfigComponent.STRING,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"sTerrainImageLocation",
pVector);
pTerrainImages.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(1);
pVector.add(new Integer(3));
cc = new ConfigComponent("Mountain Image Location",
ConfigComponent.TEXTFIELD,
new JTextField (sTerrainImageLocation[3],
40),
ConfigComponent.STRING,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"sTerrainImageLocation",
pVector);
pTerrainImages.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(1);
pVector.add(new Integer(4));
cc = new ConfigComponent("ImpassableMountain Image Location",
ConfigComponent.TEXTFIELD,
new JTextField (sTerrainImageLocation[4],
40),
ConfigComponent.STRING,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"sTerrainImageLocation",
pVector);
pTerrainImages.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(1);
pVector.add(new Integer(5));
cc = new ConfigComponent("Volcano Image Location",
ConfigComponent.TEXTFIELD,
new JTextField (sTerrainImageLocation[5],
40),
ConfigComponent.STRING,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"sTerrainImageLocation",
pVector);
pTerrainImages.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(1);
pVector.add(new Integer(6));
cc = new ConfigComponent("Ice Image Location",
ConfigComponent.TEXTFIELD,
new JTextField (sTerrainImageLocation[6],
40),
ConfigComponent.STRING,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"sTerrainImageLocation",
pVector);
pTerrainImages.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(1);
pVector.add(new Integer(7));
cc = new ConfigComponent("Tundra Image Location",
ConfigComponent.TEXTFIELD,
new JTextField (sTerrainImageLocation[7],
40),
ConfigComponent.STRING,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"sTerrainImageLocation",
pVector);
pTerrainImages.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(1);
pVector.add(new Integer(8));
cc = new ConfigComponent("Steppe Image Location",
ConfigComponent.TEXTFIELD,
new JTextField (sTerrainImageLocation[8],
40),
ConfigComponent.STRING,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"sTerrainImageLocation",
pVector);
pTerrainImages.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(1);
pVector.add(new Integer(9));
cc = new ConfigComponent("Prairie Image Location",
ConfigComponent.TEXTFIELD,
new JTextField (sTerrainImageLocation[9],
40),
ConfigComponent.STRING,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"sTerrainImageLocation",
pVector);
pTerrainImages.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(1);
pVector.add(new Integer(10));
cc = new ConfigComponent("Savannah Image Location",
ConfigComponent.TEXTFIELD,
new JTextField (sTerrainImageLocation[10],
40),
ConfigComponent.STRING,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"sTerrainImageLocation",
pVector);
pTerrainImages.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(1);
pVector.add(new Integer(11));
cc = new ConfigComponent("Forest Image Location",
ConfigComponent.TEXTFIELD,
new JTextField (sTerrainImageLocation[11],
40),
ConfigComponent.STRING,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"sTerrainImageLocation",
pVector);
pTerrainImages.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(1);
pVector.add(new Integer(12));
cc = new ConfigComponent("Jungle Image Location",
ConfigComponent.TEXTFIELD,
new JTextField (sTerrainImageLocation[12],
40),
ConfigComponent.STRING,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"sTerrainImageLocation",
pVector);
pTerrainImages.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(1);
pVector.add(new Integer(13));
cc = new ConfigComponent("Swamp Image Location",
ConfigComponent.TEXTFIELD,
new JTextField (sTerrainImageLocation[13],
40),
ConfigComponent.STRING,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"sTerrainImageLocation",
pVector);
pTerrainImages.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(1);
pVector.add(new Integer(14));
cc = new ConfigComponent("Desert Image Location",
ConfigComponent.TEXTFIELD,
new JTextField (sTerrainImageLocation[14],
40),
ConfigComponent.STRING,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"sTerrainImageLocation",
pVector);
pTerrainImages.addElement(cc);
pParameters.addElement(pTerrainImages);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
cc = new ConfigComponent("Chance of Goodies",
ConfigComponent.TEXTFIELD,
new JTextField (""+fGoodieChance, 5),
ConfigComponent.FLOAT,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"fGoodieChance",
null);
pGoodieChances.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(2);
pVector.add(new Integer(Hex.TERRAIN_DESERT));
pVector.add(new Integer(0));
cc = new ConfigComponent
("Desert-"+Hex.sGoodieStrings[Hex.GOODIE_GEMS],
ConfigComponent.TEXTFIELD,
new JTextField (pGoodieChance[Hex.TERRAIN_DESERT][0].getValue(), 5),
ConfigComponent.LABELVALUE,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"pGoodieChance",
pVector);
pGoodieChances.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(2);
pVector.add(new Integer(Hex.TERRAIN_DESERT));
pVector.add(new Integer(1));
cc = new ConfigComponent
("Desert-"+Hex.sGoodieStrings[Hex.GOODIE_QUARX],
ConfigComponent.TEXTFIELD,
new JTextField (pGoodieChance[Hex.TERRAIN_DESERT][1].getValue(), 5),
ConfigComponent.LABELVALUE,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"pGoodieChance",
pVector);
pGoodieChances.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(2);
pVector.add(new Integer(Hex.TERRAIN_DESERT));
pVector.add(new Integer(2));
cc = new ConfigComponent
("Desert-"+Hex.sGoodieStrings[Hex.GOODIE_CRYSX],
ConfigComponent.TEXTFIELD,
new JTextField (pGoodieChance[Hex.TERRAIN_DESERT][2].getValue(), 5),
ConfigComponent.LABELVALUE,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"pGoodieChance",
pVector);
pGoodieChances.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(2);
pVector.add(new Integer(Hex.TERRAIN_MOUNTAINS));
pVector.add(new Integer(0));
cc = new ConfigComponent
("Mountains-"+Hex.sGoodieStrings[Hex.GOODIE_IRON],
ConfigComponent.TEXTFIELD,
new JTextField (pGoodieChance[Hex.TERRAIN_MOUNTAINS][0].getValue(), 5),
ConfigComponent.LABELVALUE,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"pGoodieChance",
pVector);
pGoodieChances.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(2);
pVector.add(new Integer(Hex.TERRAIN_MOUNTAINS));
pVector.add(new Integer(1));
cc = new ConfigComponent
("Mountains-"+Hex.sGoodieStrings[Hex.GOODIE_COAL],
ConfigComponent.TEXTFIELD,
new JTextField (pGoodieChance[Hex.TERRAIN_MOUNTAINS][1].getValue(), 5),
ConfigComponent.LABELVALUE,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"pGoodieChance",
pVector);
pGoodieChances.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(2);
pVector.add(new Integer(Hex.TERRAIN_MOUNTAINS));
pVector.add(new Integer(2));
cc = new ConfigComponent
("Mountains-"+Hex.sGoodieStrings[Hex.GOODIE_SILVER],
ConfigComponent.TEXTFIELD,
new JTextField (pGoodieChance[Hex.TERRAIN_MOUNTAINS][2].getValue(), 5),
ConfigComponent.LABELVALUE,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"pGoodieChance",
pVector);
pGoodieChances.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(2);
pVector.add(new Integer(Hex.TERRAIN_MOUNTAINS));
pVector.add(new Integer(3));
cc = new ConfigComponent
("Mountains-"+Hex.sGoodieStrings[Hex.GOODIE_GOLD],
ConfigComponent.TEXTFIELD,
new JTextField (pGoodieChance[Hex.TERRAIN_MOUNTAINS][3].getValue(), 5),
ConfigComponent.LABELVALUE,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"pGoodieChance",
pVector);
pGoodieChances.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(2);
pVector.add(new Integer(Hex.TERRAIN_MOUNTAINS));
pVector.add(new Integer(4));
cc = new ConfigComponent
("Mountains-"+Hex.sGoodieStrings[Hex.GOODIE_MITHRIL],
ConfigComponent.TEXTFIELD,
new JTextField (pGoodieChance[Hex.TERRAIN_MOUNTAINS][4].getValue(), 5),
ConfigComponent.LABELVALUE,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"pGoodieChance",
pVector);
pGoodieChances.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(2);
pVector.add(new Integer(Hex.TERRAIN_MOUNTAINS));
pVector.add(new Integer(5));
cc = new ConfigComponent
("Mountains-"+Hex.sGoodieStrings[Hex.GOODIE_ADAMANTIUM],
ConfigComponent.TEXTFIELD,
new JTextField (pGoodieChance[Hex.TERRAIN_MOUNTAINS][5].getValue(), 5),
ConfigComponent.LABELVALUE,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"pGoodieChance",
pVector);
pGoodieChances.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(2);
pVector.add(new Integer(Hex.TERRAIN_IMPASSABLEMOUNTAINS));
pVector.add(new Integer(0));
cc = new ConfigComponent
("Impassable Mountains-"+Hex.sGoodieStrings[Hex.GOODIE_IRON],
ConfigComponent.TEXTFIELD,
new JTextField
(pGoodieChance[Hex.TERRAIN_IMPASSABLEMOUNTAINS][0].getValue(), 5),
ConfigComponent.LABELVALUE,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"pGoodieChance",
pVector);
pGoodieChances.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(2);
pVector.add(new Integer(Hex.TERRAIN_IMPASSABLEMOUNTAINS));
pVector.add(new Integer(1));
cc = new ConfigComponent
("Impassable Mountains-"+Hex.sGoodieStrings[Hex.GOODIE_COAL],
ConfigComponent.TEXTFIELD,
new JTextField
(pGoodieChance[Hex.TERRAIN_IMPASSABLEMOUNTAINS][1].getValue(), 5),
ConfigComponent.LABELVALUE,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"pGoodieChance",
pVector);
pGoodieChances.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(2);
pVector.add(new Integer(Hex.TERRAIN_IMPASSABLEMOUNTAINS));
pVector.add(new Integer(2));
cc = new ConfigComponent
("Impassable Mountains-"+Hex.sGoodieStrings[Hex.GOODIE_SILVER],
ConfigComponent.TEXTFIELD,
new JTextField
(pGoodieChance[Hex.TERRAIN_IMPASSABLEMOUNTAINS][2].getValue(), 5),
ConfigComponent.LABELVALUE,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"pGoodieChance",
pVector);
pGoodieChances.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(2);
pVector.add(new Integer(Hex.TERRAIN_IMPASSABLEMOUNTAINS));
pVector.add(new Integer(3));
cc = new ConfigComponent
("Impassable Mountains-"+Hex.sGoodieStrings[Hex.GOODIE_GOLD],
ConfigComponent.TEXTFIELD,
new JTextField
(pGoodieChance[Hex.TERRAIN_IMPASSABLEMOUNTAINS][3].getValue(), 5),
ConfigComponent.LABELVALUE,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"pGoodieChance",
pVector);
pGoodieChances.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(2);
pVector.add(new Integer(Hex.TERRAIN_IMPASSABLEMOUNTAINS));
pVector.add(new Integer(4));
cc = new ConfigComponent
("Impassable Mountains-"+Hex.sGoodieStrings[Hex.GOODIE_MITHRIL],
ConfigComponent.TEXTFIELD,
new JTextField
(pGoodieChance[Hex.TERRAIN_IMPASSABLEMOUNTAINS][4].getValue(), 5),
ConfigComponent.LABELVALUE,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"pGoodieChance",
pVector);
pGoodieChances.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(2);
pVector.add(new Integer(Hex.TERRAIN_IMPASSABLEMOUNTAINS));
pVector.add(new Integer(5));
cc = new ConfigComponent
("Impassable Mountains-"+Hex.sGoodieStrings[Hex.GOODIE_ADAMANTIUM],
ConfigComponent.TEXTFIELD,
new JTextField
(pGoodieChance[Hex.TERRAIN_IMPASSABLEMOUNTAINS][5].getValue(), 5),
ConfigComponent.LABELVALUE,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"pGoodieChance",
pVector);
pGoodieChances.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(2);
pVector.add(new Integer(Hex.TERRAIN_FOREST));
pVector.add(new Integer(0));
cc = new ConfigComponent
("Forest-"+Hex.sGoodieStrings[Hex.GOODIE_WILDGAME],
ConfigComponent.TEXTFIELD,
new JTextField
(pGoodieChance[Hex.TERRAIN_FOREST][0].getValue(), 5),
ConfigComponent.LABELVALUE,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"pGoodieChance",
pVector);
pGoodieChances.addElement(cc);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
try {
pVector = new Vector(2);
pVector.add(new Integer(Hex.TERRAIN_SWAMP));
pVector.add(new Integer(0));
cc = new ConfigComponent
("Swamp-"+Hex.sGoodieStrings[Hex.GOODIE_NIGHTSHADE],
ConfigComponent.TEXTFIELD,
new JTextField
(pGoodieChance[Hex.TERRAIN_SWAMP][0].getValue(), 5),
ConfigComponent.LABELVALUE,
Class.forName("com.devnullsoftware.javaterrain.MapParams"),
"pGoodieChance",
pVector);
pGoodieChances.addElement(cc);
pParameters.addElement(pGoodieChances);
}
catch (ClassNotFoundException e) {
System.out.println("oops4");
}
return pParameters;
}
public void postConfig () throws Exception {
MediaTracker pTracker = new MediaTracker
(Main.pThisApplet);
int i;
for (i = 0; i <= Hex.NUM_TERRAIN; i++) {
try {
pTerrainImage[i]
= Toolkit.getDefaultToolkit().getImage
(getClass().getResource(sTerrainImageLocation[i]));
}
catch (NullPointerException e) {
System.out.println ("FileName "+sTerrainImageLocation[i]+" not found\n");
pTerrainImage[i] = null;
}
if (pTerrainImage[i] != null) {
pTracker.addImage(pTerrainImage[i], 0);
}
}
try {
pTracker.waitForID(0);
}
catch (InterruptedException e) {
}
if (pMap == null) {
pMap = Map.createWorld(this);
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
d.height = (int)((double)d.height * 3.0 / 4.0);
d.width = (int)((double)d.width * 3.0 / 4.0);
MapWindow pMapWindow = new MapWindow(pMap,
d.width,d.height);
}
else {
pMap.reCreateWorld();
}
}
}