Package civquest.io

Examples of civquest.io.Messages


    String whichCityView = ruleField.getStringValue();
    if (whichCityView.equals("LayeredCityView")) {
      return new QuadIsoLayCityView(position, this, quadMap,
                       registry, tilesIsoImageSet, size, gameData);
    } else {
      Messages messages = Messages.getMessages();
      messages.err("QuadIsoLayeredFV", whichCityView
             + " is not a valid city-view!!!");
      messages.err("QuadIsoLayeredFV",
             "--> Using LayeredCityView instead");
      return new QuadIsoLayCityView(position, this, quadMap,
                       registry, tilesIsoImageSet, size, gameData);
    }   
  }
View Full Code Here


    String whichUnitView = ruleField.getStringValue();
    if (whichUnitView.equals("LayeredUnitView")) {
      return new QuadIsoLayUnitView(position, this, quadMap, registry,
                      tilesIsoImageSet, size, properties, gameData);
    } else {
      Messages messages = Messages.getMessages();
      messages.err("QuadIsoLayeredFV", whichUnitView
             + " is not a valid unit-view!!!");
      messages.err("QuadIsoLayeredFV",
             "--> Using LayeredUnitView instead");
      return new QuadIsoLayUnitView(position, this, quadMap, registry,
                      tilesIsoImageSet, size, properties, gameData);
    }
  }   
View Full Code Here

      cityView.executeFunction(functionName, position);
    } else if (name.indexOf("-") < 0) {
      // A function of this FieldView
    } else {
      // unknown subcomponent
      Messages messages = Messages.getMessages();
      messages.err("QuadIsoLayeredFV", "Unknown function: " + name);
      System.exit(-1);
    }
  }
View Full Code Here

  private void printHeightImageMissingError(Coordinate position) {
    // Even the default-image doesn't exist - for now, we abort
    // CivQuest because of that

    Messages messages = Messages.getMessages();

    messages.err("QuadIsoLayTerrainView", "updateImage: No image for field " + position);
    messages.err("QuadIsoLayTerrainView", "--> (hint: if we don't find the image we want, "
           + "we try to take Default.png)");
    messages.err("QuadIsoLayTerrainView", "--> So: Create a default-image! " +
           "CivQuest will abort NOW!!!");
    System.exit(-1);
  }
View Full Code Here

    } else if (heightLevel == Field.Height.HIGH_MOUNTAIN) {
      return "High_Mountain";
    } else if (heightLevel == Field.Height.LAND_VOLCANO) {
      return "Land_Volcano";
    } else {
      Messages messages = Messages.getMessages();
      messages.err("QuadIsoLayTerrainView", "getImageHeightString: Invalid height-level");
      messages.err("QuadIsoLayTerrainView", "--> CivQuest will abort NOW!!!");
      System.exit(-1);
      return null;
    }
  }
View Full Code Here

    }
  }

  public boolean imageUpdate(Image image, int flags, int x, int y, int width, int height) {
    if ((flags & ImageObserver.ERROR) != 0) {
      Messages messages = Messages.getMessages();
      messages.err("QuadIsoLayTerrainView",
             "imageUpdate: Flags signal error!");
    } else if ((flags & ImageObserver.ALLBITS) != 0) {
      parent.repaintChildFieldView(this);
    }
View Full Code Here

        buffer.setImage(image);
    try {
      repaintBuffer(buffer);
    } catch (InvalidImageException e) {
      Messages messages = Messages.getMessages();
      messages.err("BufferManager", "Error when trying to paint buffer " + buffer);
      messages.err("BufferManager", "--> Reason: " + e);
      messages.err("BufferManager", "--> Aborting CivQuest!!!");
      System.exit(-1);
    }
  }
View Full Code Here

    private void loadConfiguration() throws ConfigurationException {
    loadConfiguration("mapgenerator");
  }
    private void loadConfiguration(String ruleset) throws ConfigurationException {
    Messages messages = Messages.getMessages();

    Section gensection = registry.getRuleset(ruleset).getSection("general");
    width = gensection.getField("width").getIntValue();
    height = gensection.getField("height").getIntValue();
    flatearth = gensection.getField("flatearth").getBoolValue();
    civquest.parser.ruleset.Field f = gensection.getField("maptype");
      String whichmvstring = f.getStringValue();
      if(whichmvstring.equals("flat")) {
      maptype = FLAT;
    } else if(whichmvstring.equals("isometric")) {
        maptype = ISOMETRIC;
    } else {
      messages.err("MapGenerator",
             "WARNING: Can't determine whichmapview! Assuming flat");
      maptype = FLAT;
    }
    Section generatorsection = registry.getRuleset(ruleset).getSection("generators");
    String heightgen = generatorsection.getField("height").getStringValue();
    if(heightgen.equals("PlateHeightGenerator")) {
      heightGenerator = new PlateHeightGenerator(registry);
    } else {
      messages.err("MapGenerator", "loadConfiguration: "
             + heightgen + " is not a valid " +
             "HeightGenerator!!! Using NO HeightGenerator!!!");
      heightGenerator = null;
    }

    String veggen = generatorsection.getField("vegetation").getStringValue();
    if(veggen.equals("ClimateGenerator")) {
      vegetationGenerator = new ClimateGenerator(maptype,registry);
    } else {
      messages.err("MapGenerator",
             "loadConfiguration: " + veggen + " is not a valid " +
             "VegetationGenerator!!! Using NO VegetationGenerator!!!");
      vegetationGenerator = null;
    }

    String rivgen = generatorsection.getField("rivers").getStringValue();

    if(rivgen.equals("MWFCRiverGenerator")) {
      riverGenerator = new MWFCRiverGenerator(registry);
    } else {
      messages.err("MapGenerator",
             "loadConfiguration: " + rivgen + " is not a valid " +
             "RiverGenerator!!! Using NO RiverGenerator!!!");
      riverGenerator = null;
    }
View Full Code Here

    Section rivsection = registry.getRuleset(ruleset).getSection("rivers");
    minbigriverwaterflow = rivsection.getField("minbigriverwaterflow").getIntValue();
    }

    private void dumpConfiguration() {
    Messages messages = Messages.getMessages();
    messages.info("MapGenerator", "GenMapGenConf", "MapGenerator-configuration");
    messages.info("MapGenerator", "GenMapGenConf", "width = " + width);
    messages.info("MapGenerator", "GenMapGenConf", "height = " + height);
    messages.info("MapGenerator", "GenMapGenConf", "flatearth = " + flatearth);

    String mapType;
    if(maptype == FLAT) {
      mapType = "flat";
    } else if (maptype == ISOMETRIC) {
      mapType = "isometric";
    } else {
      mapType = "not-known";
    }
    messages.info("MapGenerator", "GenMapGenConf", "map-type = " + mapType);

    messages.info("MapGenerator", "GenMapGenConf", "Generators:");
    if (heightGenerator instanceof PlateHeightGenerator) {
      messages.info("MapGenerator", "GenMapGenConf",
              "---> HeightGenerator: PlateHeightGenerator");
    } else {
      messages.info("MapGenerator", "GenMapGenConf",
              "---> NO HEIGHTGENERATOR!!!");
    }

    if(vegetationGenerator instanceof ClimateGenerator) {
      messages.info("MapGenerator", "GenMapGenConf",
              "---> VegetationGenerator: ClimateGenerator");
    } else {
      messages.info("MapGenerator", "GenMapGenConf",
              "---> NO VEGETATIONGENERATOR!!!");
    }

    if(riverGenerator instanceof MWFCRiverGenerator) {
      messages.info("MapGenerator", "GenMapGenConf",
              "---> RiverGenerator: MWFCRiverGenerator");
    } else {
      messages.info("MapGenerator", "GenMapGenConf",
              "---> NO RIVERGENERATOR!!!");
    }

    messages.info("MapGenerator", "GenMapGenConf",
            "minbigriverwaterflow = " + minbigriverwaterflow);
    }
View Full Code Here

      && cityReader.getCityID(position) != null) {
      cityImage = layCityImageSet.getImage("Village");
   
   
      if (cityImage == null) {
        Messages messages = Messages.getMessages();
        messages.err("QuadIsoLayCityView",
               "updateImage: Image Village.png for " +
               "painting a city doesn't exist!");
        messages.err("QuadIsoLayCityView",
               "--> CivQuest will abort NOW!!!");
        System.exit(-1);
      }
    } else {
      cityImage = null;
View Full Code Here

TOP

Related Classes of civquest.io.Messages

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.