Package civquest.map

Examples of civquest.map.VegetationData$HeightLevelData


    protected int mapType;

    public TestClimateGenerator(int mapType, Registry registry) throws RulesetException {
        this.mapType = mapType;
        this.registry = registry;
        grass = new VegetationData(registry,"grass");
        ocean = new VegetationData(registry,"ocean");
    }
View Full Code Here


        this.ruleset = ruleset;
  java.util.List<Section> sections = registry.getRuleset(ruleset).getAllSections();
  for (int sc = 0; sc<sections.size(); sc++){
      Section currentSection = (Section)sections.get(sc);
      if (currentSection.getName().equals("rulesets")){
    land = new VegetationData(registry,currentSection.getField("land").getStringValue());
    ocean = new VegetationData(registry,currentSection.getField("water").getStringValue());
                civquest.parser.ruleset.Field tempField = currentSection.getField("ground");
                if (tempField!=null){
                    int groundCount = tempField.getNumberOfValues();
                    for (int i = 0; i<groundCount; i++)
                        groundData.add(new VegetationData(registry,currentSection.getField("ground").getStringValue(i)));
                }

                if (currentSection.hasField("terrain")){
          tempField = currentSection.getField("terrain");
                    int terrainCount = tempField.getNumberOfValues();
                    for (int i = 0; i<terrainCount; i++)
                        terrainData.add(new VegetationData(registry,currentSection.getField("terrain").getStringValue(i)));
                }
      } else if (currentSection.getName().equals("streams")) {
    streams = currentSection.getField("number").getIntValue();
      } else if (currentSection.getName().equals("air")) {
    eqTemp = currentSection.getField("eqTemp").getIntValue();
View Full Code Here

                    Field f = mapData.getField(x,y);
        if (!f.isSea()){
      int h = f.getHumidity();
      int t = f.getTemperature();
      for (int i = 0; i<groundData.size(); i++){
          VegetationData w = (VegetationData)groundData.get(i);         
          SimpleConditionParser parse = new SimpleConditionParser(((VegetationData)groundData.get(i)).getCondition());
          parse.setH(h);
          parse.setT(t);
          if (parse.eval()){
        int prob = getProbability(w,new Coordinate(x,y), Field.LAYER_TERRAIN);
        if ((Util.getRandomNumber(10)+1)<=prob && (prob>0))
            f.setValues(w,Field.LAYER_GROUND,mapType);
          }         
      }
      for (int i = 0; i<terrainData.size(); i++){
          VegetationData w = (VegetationData)terrainData.get(i);         
          SimpleConditionParser parse = new SimpleConditionParser(w.getCondition());         
          parse.setH(h);
          parse.setT(t);
          if (parse.eval()){
        int prob = getProbability(w,new Coordinate(x,y), Field.LAYER_TERRAIN);
        if ((Util.getRandomNumber(10)+1)<=prob && (prob>0))
View Full Code Here

                }
                Field.Height height = Field.getHeightConstant(
                        this.scenarioEditor.getSelectedHeight());

                String vegName = this.scenarioEditor.getSelectedVegetation();
                VegetationData vegetation = new VegetationData(
                        this.registry, vegName);
                if (paintSize.equals(SMALL_PAINT_SIZE)) {
                    //mode for painting one field
                    VegetationChange fieldChange = new VegetationChange(
                            field, height, vegetation, this.map);
View Full Code Here

        for (;mfit.hasNext();) {
            Coordinate coord = mfit.next();
            Field field = mapData.getField(coord);
            field.setHeightLevel(Field.getHeightConstant(height));
            try {
                field.setValues(new VegetationData(
                        this.registry, vegName), -1, -1);
            } catch (RulesetException rse) {
                CivQuest.showErrorQuitDialog("There was an error " +
                        "related to ruleset-loading: ", rse);
            }
View Full Code Here

TOP

Related Classes of civquest.map.VegetationData$HeightLevelData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.