Package civquest.map.resource

Examples of civquest.map.resource.ResourceDefinition


      if (physUnit == null) {
        throw new RulesetException("While loading resource-definitions: "
                       + physUnitString + " is not a valid "
                       + "unit-identifier! (definitions.ruleset)");
      } else {
        resourceDefinitions.put(name, new ResourceDefinition(name, physUnit));

        messages.info("MapData-Config", "ResourceConf", "Adding resource " + name);
        messages.info("MapData-Config", "ResourceConf", "    --> StandardUnit: "
                + physUnit);
      }
View Full Code Here


  private void constructResDefs(LoadingStep step) throws Exception {
    resourceDefinitions  = new HashMap<String, ResourceDefinition>();
    Set<LoadedData> resDefSet = loadedData.getLoadedDataHashSet(RES_DEFS);
    for (LoadedData resDefData : resDefSet) {
      ResourceDefinition newDef = new ResourceDefinition(resDefData, step);
      resourceDefinitions.put(newDef.getName(), newDef);
    }
  }
View Full Code Here

     
      if (!(mapConfig.resourceExists(resourceName))) {
        throw new ConfigurationException(resourceName + " is not a valid "
                         + "resource name!");
      } else {
        ResourceDefinition resourceDef = mapConfig.getResourceDefinition(resourceName);
        PhysicalAmount.PhysicalUnit standardUnit = resourceDef.getStandardUnit();
       
        if ((!amount.getUnit().canTransform(standardUnit))) {
          String msg = "Can't transform unit " + amount.getUnit() +
            " into standard unit for resource " + resourceName +
            ", which is " + standardUnit;
View Full Code Here

TOP

Related Classes of civquest.map.resource.ResourceDefinition

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.