📄 mapsettings.java
字号:
/* * MegaMek - Copyright (C) 2002,2003 Ben Mazur (bmazur@sev.org) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. */package megamek.common;import gd.xml.ParseException;import gd.xml.tiny.ParsedXML;import gd.xml.tiny.TinyParser;import java.util.*;import java.io.*;/** * * MapSettings.java * * Created on March 27, 2002, 1:07 PM * @author Ben * @version */public class MapSettings implements Serializable { public static final String BOARD_RANDOM = "[RANDOM]"; public static final String BOARD_SURPRISE = "[SURPRISE]"; public static final String BOARD_GENERATED = "[GENERATED]"; public static final int MOUNTAIN_PLAIN = 0; public static final int MOUNTAIN_VOLCANO_EXTINCT = 1; public static final int MOUNTAIN_VOLCANO_DORMANT = 2; public static final int MOUNTAIN_VOLCANO_ACTIVE = 3; public static final int MOUNTAIN_SNOWCAPPED = 4; public static final int MOUNTAIN_LAKE = 5; private int boardWidth = 16; private int boardHeight = 17; private int mapWidth = 1; private int mapHeight = 1; private Vector boardsSelected = new Vector(); private Vector boardsAvailable = new Vector(); //new vector to store all of the mapsetting buildings in. private Vector boardBuildings = new Vector(); /** Parameters for the Map Generator Parameters refer to a default map siz 16 x 17, with other size some of the parameters get linear transformed to give good result for new size */ /** how much hills there should be, Range 0..99 */ private int hilliness = 40; /** how much cliffs should there be, range 0-100 (% chance for each cliff candidate)*/ private int cliffs = 0; /** Maximum difference between highest elevation and lowest sink */ private int range = 5; /** Probabiltity for invertion of the map, Range 0..100 */ private int probInvert = 5; /** how much Lakes at least */ private int minWaterSpots = 1; /** how much Lakes at most */ private int maxWaterSpots = 3; /** minimum size of a lake */ private int minWaterSize = 5; /** maximum Size of a lake */ private int maxWaterSize = 10; /** probability for water deeper than lvl1, Range 0..100 */ private int probDeep = 33; /** how much forests at least */ private int minForestSpots = 3; /** how much forests at most */ private int maxForestSpots = 8; /** minimum size of a forest */ private int minForestSize = 4; /** maximum Size of a forest */ private int maxForestSize = 12; /** probability for heavy woods, Range 0..100 */ private int probHeavy = 30; /** how much rough spots at least */ private int minRoughSpots = 2; /** how much rough spots at most */ private int maxRoughSpots = 10; /** minimum size of a rough spot */ private int minRoughSize = 1; /** maximum Size of a rough spot */ private int maxRoughSize = 2; /** how much swamp spots at least */ private int minSwampSpots = 2; /** how much swamp spots at most */ private int maxSwampSpots = 10; /** minimum size of a swamp spot */ private int minSwampSize = 1; /** maximum Size of a swamp spot */ private int maxSwampSize = 2; /** how much pavement spots at least */ private int minPavementSpots = 0; /** how much pavement spots at most */ private int maxPavementSpots = 0; /** minimum size of a pavement spot */ private int minPavementSize = 1; /** maximum Size of a pavement spot */ private int maxPavementSize = 6; /** how much rubble spots at least */ private int minRubbleSpots = 0; /** how much rubble spots at most */ private int maxRubbleSpots = 0; /** minimum size of a rubble spot */ private int minRubbleSize = 1; /** maximum Size of a rubble spot */ private int maxRubbleSize = 6; /** how much fortified spots at least */ private int minFortifiedSpots = 0; /** how much fortified spots at most */ private int maxFortifiedSpots = 0; /** minimum size of a fortified spot */ private int minFortifiedSize = 1; /** maximum Size of a fortified spot */ private int maxFortifiedSize = 2; /** how much ice spots at least */ private int minIceSpots = 0; /** how much ice spots at most */ private int maxIceSpots = 0; /** minimum size of a ice spot */ private int minIceSize = 1; /** maximum Size of a ice spot */ private int maxIceSize = 6; /** probability for a road, range 0..100 */ private int probRoad = 0; /** probability for a river, range 0..100 */ private int probRiver = 0; /** probabilitay for Crater 0..100 */ private int probCrater = 0; /** minimum Radius of the Craters */ private int minRadius = 2; /** maximum Radius of the Craters */ private int maxRadius = 7; /** maximum Number of Craters on one map */ private int maxCraters = 2; /** minimum Number of Craters on one map */ private int minCraters = 1; /** which landscape generation Algortihm to use */ /* atm there are 2 different: 0= first, 1=second */ private int algorithmToUse = 0; /** a tileset theme to apply */ private String theme = ""; /** probability of flooded map */ private int probFlood = 0; /** probability of forest fire */ private int probForestFire = 0; /** probability of frozen map */ private int probFreeze = 0; /** probability of drought */ private int probDrought = 0; /** special FX modifier */ private int fxMod = 0; /** Parameters for the city generator */ private int cityBlocks = 16; private String cityType = "NONE"; private int cityMinCF = 10; private int cityMaxCF = 100; private int cityMinFloors = 1; private int cityMaxFloors = 6; private int cityDensity = 75; private int townSize = 60; private int invertNegativeTerrain = 0; private int mountainPeaks = 0; private int mountainWidthMin = 7; private int mountainWidthMax = 20; private int mountainHeightMin = 5; private int mountainHeightMax = 8; private int mountainStyle = MOUNTAIN_PLAIN; /** end Map Generator Parameters */ /** Creates new MapSettings */ public MapSettings() { this(16, 17, 1, 1); } /** Create new MapSettings with all size settings specified */ public MapSettings(int boardWidth, int boardHeight, int mapWidth, int mapHeight) { setBoardSize(boardWidth, boardHeight); setMapSize(mapWidth, mapHeight); } /** Creates new MapSettings that is a duplicate of another */ public MapSettings(MapSettings other) { this.boardWidth = other.getBoardWidth(); this.boardHeight = other.getBoardHeight(); this.mapWidth = other.getMapWidth(); this.mapHeight = other.getMapHeight(); this.boardsSelected = (Vector)other.getBoardsSelectedVector().clone(); this.boardsAvailable = (Vector)other.getBoardsAvailableVector().clone(); this.invertNegativeTerrain = other.getInvertNegativeTerrain(); this.mountainHeightMin = other.getMountainHeightMin(); this.mountainHeightMax = other.getMountainHeightMax(); this.mountainPeaks = other.getMountainPeaks(); this.mountainStyle = other.getMountainStyle(); this.mountainWidthMin = other.getMountainWidthMin(); this.mountainWidthMax = other.getMountainWidthMax(); this.hilliness = other.getHilliness(); this.cliffs = other.getCliffs(); this.range = other.getRange(); this.probInvert = other.getProbInvert(); this.minWaterSpots = other.getMinWaterSpots(); this.maxWaterSpots = other.getMaxWaterSpots(); this.minWaterSize = other.getMinWaterSize(); this.maxWaterSize = other.getMaxWaterSize(); this.probDeep = other.getProbDeep(); this.minForestSpots = other.getMinForestSpots(); this.maxForestSpots = other.getMaxForestSpots(); this.minForestSize = other.getMinForestSize(); this.maxForestSize = other.getMaxForestSize(); this.probHeavy = other.getProbHeavy(); this.minRoughSpots = other.getMinRoughSpots(); this.maxRoughSpots = other.getMaxRoughSpots(); this.minRoughSize = other.getMinRoughSize(); this.maxRoughSize = other.getMaxRoughSize(); this.minSwampSpots = other.getMinSwampSpots(); this.maxSwampSpots = other.getMaxSwampSpots(); this.minSwampSize = other.getMinSwampSize(); this.maxSwampSize = other.getMaxSwampSize(); this.minPavementSpots = other.getMinPavementSpots(); this.maxPavementSpots = other.getMaxPavementSpots(); this.minPavementSize = other.getMinPavementSize(); this.maxPavementSize = other.getMaxPavementSize(); this.minRubbleSpots = other.getMinRubbleSpots(); this.maxRubbleSpots = other.getMaxRubbleSpots(); this.minRubbleSize = other.getMinRubbleSize(); this.maxRubbleSize = other.getMaxRubbleSize(); this.minFortifiedSpots = other.getMinFortifiedSpots(); this.maxFortifiedSpots = other.getMaxFortifiedSpots(); this.minFortifiedSize = other.getMinFortifiedSize(); this.maxFortifiedSize = other.getMaxFortifiedSize(); this.minIceSpots = other.getMinIceSpots(); this.maxIceSpots = other.getMaxIceSpots(); this.minIceSize = other.getMinIceSize(); this.maxIceSize = other.getMaxIceSize(); this.probRoad = other.getProbRoad(); this.probRiver = other.getProbRiver(); this.probCrater = other.getProbCrater(); this.minRadius = other.getMinRadius(); this.maxRadius = other.getMaxRadius(); this.minCraters = other.getMinCraters(); this.maxCraters = other.getMaxCraters(); this.algorithmToUse = other.getAlgorithmToUse(); this.theme = other.getTheme(); this.probFlood = other.getProbFlood(); this.probForestFire = other.getProbForestFire(); this.probFreeze = other.getProbFreeze(); this.probDrought = other.getProbDrought(); this.fxMod = other.getFxMod(); this.cityBlocks = other.getCityBlocks(); this.cityType = other.getCityType(); this.cityMinCF = other.getCityMinCF(); this.cityMaxCF = other.getCityMaxCF(); this.cityMinFloors = other.getCityMinFloors(); this.cityMaxFloors = other.getCityMaxFloors(); this.cityDensity = other.getCityDensity(); this.boardBuildings = other.getBoardBuildings(); } public int getBoardWidth() { return boardWidth; } public int getBoardHeight() { return boardHeight; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -