Esempio n. 1
0
  private void readTechnique(Statement techStat) throws IOException {
    isUseNodes = false;
    String[] split = techStat.getLine().split(whitespacePattern);
    if (split.length == 1) {
      technique = new TechniqueDef(null);
    } else if (split.length == 2) {
      String techName = split[1];
      technique = new TechniqueDef(techName);
    } else {
      throw new IOException("Technique statement syntax incorrect");
    }

    for (Statement statement : techStat.getContents()) {
      readTechniqueStatement(statement);
    }

    if (isUseNodes) {
      nodesLoaderDelegate.computeConditions();
      // used for caching later, the shader here is not a file.
      technique.setShaderFile(
          technique.hashCode() + "", technique.hashCode() + "", "GLSL100", "GLSL100");
    }

    if (shaderName.containsKey(Shader.ShaderType.Vertex)
        && shaderName.containsKey(Shader.ShaderType.Fragment)) {
      technique.setShaderFile(shaderName, shaderLanguage);
    }

    materialDef.addTechniqueDef(technique);
    technique = null;
    shaderLanguage.clear();
    shaderName.clear();
  }
 @Override
 public void clear() {
   wL.lock();
   try {
     super.clear();
   } finally {
     wL.unlock();
   }
 }
Esempio n. 3
0
  @SuppressWarnings("unchecked")
  public static void shutdown() {
    synchronized (AbstractCacheBean.class) {
      shutdown = true;

      // executors is null if we've never called getExecutorInternal
      if (executors != null) {
        for (UniqueTaskExecutor executor : executors.values()) {
          executor.shutdownAndAwaitTermination();
        }
        executors.clear();
        executors = null;
      }
    }
  }
  /* (non-Javadoc)
   * @see pacman.controllers.Controller#getMove(pacman.game.Game, long)
   */
  public EnumMap<GHOST, MOVE> getMove(Game game, long timeDue) {
    myMoves.clear();

    int targetNode = game.getPacmanCurrentNodeIndex();

    if (game.doesGhostRequireAction(GHOST.BLINKY))
      myMoves.put(
          GHOST.BLINKY,
          game.getApproximateNextMoveTowardsTarget(
              game.getGhostCurrentNodeIndex(GHOST.BLINKY),
              targetNode,
              game.getGhostLastMoveMade(GHOST.BLINKY),
              DM.PATH));

    if (game.doesGhostRequireAction(GHOST.INKY))
      myMoves.put(
          GHOST.INKY,
          game.getApproximateNextMoveTowardsTarget(
              game.getGhostCurrentNodeIndex(GHOST.INKY),
              targetNode,
              game.getGhostLastMoveMade(GHOST.INKY),
              DM.MANHATTAN));

    if (game.doesGhostRequireAction(GHOST.PINKY))
      myMoves.put(
          GHOST.PINKY,
          game.getApproximateNextMoveTowardsTarget(
              game.getGhostCurrentNodeIndex(GHOST.PINKY),
              targetNode,
              game.getGhostLastMoveMade(GHOST.PINKY),
              DM.EUCLID));

    if (game.doesGhostRequireAction(GHOST.SUE))
      myMoves.put(GHOST.SUE, moves[rnd.nextInt(moves.length)]);

    return myMoves;
  }
Esempio n. 5
0
 public static void load() {
   final FileConfiguration config = UDSPlugin.getPlugin().getConfig();
   BLOCK_CREEPERS = config.getBoolean("block.creeper");
   BLOCK_ENDERMEN = config.getBoolean("block.endermen");
   BLOCK_SILVERFISH = config.getBoolean("block.silverfish");
   BLOCK_TNT = config.getBoolean("block.tnt");
   BLOCK_WITHER = config.getBoolean("block.wither");
   MAP_DATA = (byte) config.getInt("map-data");
   BASE_COST = config.getInt("cost.base");
   BUILD_COST = config.getInt("cost.build");
   CITY_COST = config.getInt("cost.city");
   CLAN_COST = config.getInt("cost.clan");
   EXPAND_COST = config.getInt("cost.expand");
   HOME_COST = config.getInt("cost.home");
   MAP_COST = config.getInt("cost.map");
   SHOP_COST = config.getInt("cost.shop");
   VIP_COST = config.getInt("cost.vip");
   UNDO_COUNT = config.getInt("range.undo");
   DRAIN_RANGE = config.getInt("range.drain");
   MOVE_RANGE = config.getInt("range.move");
   EDIT_RANGE = config.getInt("range.edit");
   COMPASS_RANGE = config.getInt("range.compass");
   BUTCHER_RANGE = config.getInt("range.butcher");
   VIP_SPAWNS = config.getInt("vip.spawns");
   WORLD_BORDER = config.getInt("range.world");
   WORLD_BORDER_SQRD = WORLD_BORDER * WORLD_BORDER;
   SPAWNER_EXP = config.getInt("exp.spawner");
   REQUEST_TTL = config.getLong("request-timeout") * TimeUtils.SECOND;
   MINECART_TTL = config.getLong("minecart.life") * TimeUtils.SECOND;
   PVP_TIME = config.getLong("pvp-time") * TimeUtils.SECOND;
   SLOW_TIME = config.getLong("auto-save") * TimeUtils.MINUTE;
   DRAGON_RESPAWN = config.getLong("respawn-dragon") * TimeUtils.MINUTE;
   VIP_TIME = config.getLong("vip.time") * TimeUtils.DAY;
   CURRENCIES = config.getString("currency.plural");
   WELCOME_MSG = config.getString("welcome.message");
   WELCOME_ADMIN = config.getString("welcome.admin");
   SERVER_OWNER = config.getString("server-owner");
   CURRENCY = config.getString("currency.singular");
   MAIN_WORLD = config.getString("world-name");
   WELCOME_GIFT = Material.getMaterial(config.getString("welcome.gift"));
   if (WELCOME_GIFT == null) WELCOME_GIFT = Material.EMERALD;
   SERVER_RULES = config.getStringList("server-rules");
   PISTON_POWER = config.getDouble("piston-power");
   SHARES = config.getStringList("inventory-shares");
   GMAIL_ADDRESS = config.getString("gmail.email");
   SKULL = config.getDouble("head-drop-chance");
   GMAIL_PASSWORD = config.getString("gmail.password");
   VIP_WHITELIST.clear();
   for (int typeId : config.getIntegerList("item-whitelist")) {
     VIP_WHITELIST.add(Material.getMaterial(typeId));
   }
   KITS.clear();
   for (String kit : config.getStringList("kits")) {
     final String[] kitSplit = kit.split(",");
     final List<ItemStack> items =
         new ArrayList<ItemStack>(ArrayUtils.subarray(kitSplit, 3, kitSplit.length - 1).length);
     for (Object item : ArrayUtils.subarray(kitSplit, 3, kitSplit.length - 1)) {
       items.add(new ItemStack(Material.getMaterial(Integer.parseInt((String) item))));
     }
     KITS.add(
         new Kit(
             kitSplit[0],
             Integer.parseInt(kitSplit[1]),
             items,
             PlayerRank.getByName(kitSplit[2])));
   }
   MOB_REWARDS.clear();
   for (EntityType entityType : EntityType.values()) {
     String entityName = "mob-rewards." + entityType.getName();
     if (entityName != null) {
       entityName = entityName.toLowerCase();
       MOB_REWARDS.put(entityType, config.getInt(entityName));
     }
   }
   GLOBAL_FLAGS.clear();
   for (RegionFlag flag : RegionFlag.values()) {
     final String flagname = "global-flags." + flag.toString().toLowerCase();
     GLOBAL_FLAGS.put(flag, config.getBoolean(flagname));
   }
 }
Esempio n. 6
0
 /**
  * Removes any door, water, or trap insertion effects that this DungeonGenerator would put in
  * future dungeons.
  *
  * @return this DungeonGenerator, with all effects removed. Can be chained.
  */
 public DungeonGenerator clearEffects() {
   fx.clear();
   return this;
 }
 @Override
 public void reconfigure(DeviceExtension from) {
   ArchiveDeviceExtension arcdev = (ArchiveDeviceExtension) from;
   defaultCharacterSet = arcdev.defaultCharacterSet;
   fuzzyAlgorithmClass = arcdev.fuzzyAlgorithmClass;
   fuzzyStr = arcdev.fuzzyStr;
   storageID = arcdev.storageID;
   metadataStorageID = arcdev.metadataStorageID;
   seriesMetadataStorageID = arcdev.seriesMetadataStorageID;
   seriesMetadataDelay = arcdev.seriesMetadataDelay;
   seriesMetadataPollingInterval = arcdev.seriesMetadataPollingInterval;
   seriesMetadataFetchSize = arcdev.seriesMetadataFetchSize;
   purgeInstanceRecordsDelay = arcdev.purgeInstanceRecordsDelay;
   purgeInstanceRecordsPollingInterval = arcdev.purgeInstanceRecordsPollingInterval;
   purgeInstanceRecordsFetchSize = arcdev.purgeInstanceRecordsFetchSize;
   overwritePolicy = arcdev.overwritePolicy;
   showPatientInfoInSystemLog = arcdev.showPatientInfoInSystemLog;
   showPatientInfoInAuditLog = arcdev.showPatientInfoInAuditLog;
   bulkDataSpoolDirectory = arcdev.bulkDataSpoolDirectory;
   queryRetrieveViewID = arcdev.queryRetrieveViewID;
   personNameComponentOrderInsensitiveMatching =
       arcdev.personNameComponentOrderInsensitiveMatching;
   sendPendingCGet = arcdev.sendPendingCGet;
   sendPendingCMoveInterval = arcdev.sendPendingCMoveInterval;
   wadoSupportedSRClasses.clear();
   wadoSupportedSRClasses.addAll(arcdev.wadoSupportedSRClasses);
   wadoSR2HtmlTemplateURI = arcdev.wadoSR2HtmlTemplateURI;
   wadoSR2TextTemplateURI = arcdev.wadoSR2TextTemplateURI;
   patientUpdateTemplateURI = arcdev.patientUpdateTemplateURI;
   importReportTemplateURI = arcdev.importReportTemplateURI;
   scheduleProcedureTemplateURI = arcdev.scheduleProcedureTemplateURI;
   qidoMaxNumberOfResults = arcdev.qidoMaxNumberOfResults;
   queryRetrieveViewMap.clear();
   queryRetrieveViewMap.putAll(arcdev.queryRetrieveViewMap);
   mppsForwardDestinations = arcdev.mppsForwardDestinations;
   ianDestinations = arcdev.ianDestinations;
   ianDelay = arcdev.ianDelay;
   ianTimeout = arcdev.ianTimeout;
   ianOnTimeout = arcdev.ianOnTimeout;
   ianTaskPollingInterval = arcdev.ianTaskPollingInterval;
   ianTaskFetchSize = arcdev.ianTaskFetchSize;
   fallbackCMoveSCP = arcdev.fallbackCMoveSCP;
   fallbackCMoveSCPDestination = arcdev.fallbackCMoveSCPDestination;
   fallbackCMoveSCPLeadingCFindSCP = arcdev.fallbackCMoveSCPLeadingCFindSCP;
   fallbackCMoveSCPRetries = arcdev.fallbackCMoveSCPRetries;
   externalRetrieveAEDestination = arcdev.externalRetrieveAEDestination;
   alternativeCMoveSCP = arcdev.alternativeCMoveSCP;
   exportTaskPollingInterval = arcdev.exportTaskPollingInterval;
   exportTaskFetchSize = arcdev.exportTaskFetchSize;
   deleteRejectedPollingInterval = arcdev.deleteRejectedPollingInterval;
   deleteRejectedFetchSize = arcdev.deleteRejectedFetchSize;
   purgeStoragePollingInterval = arcdev.purgeStoragePollingInterval;
   purgeStorageFetchSize = arcdev.purgeStorageFetchSize;
   deleteStudyBatchSize = arcdev.deleteStudyBatchSize;
   deletePatientOnDeleteLastStudy = arcdev.deletePatientOnDeleteLastStudy;
   maxAccessTimeStaleness = arcdev.maxAccessTimeStaleness;
   aeCacheStaleTimeout = arcdev.aeCacheStaleTimeout;
   leadingCFindSCPQueryCacheStaleTimeout = arcdev.leadingCFindSCPQueryCacheStaleTimeout;
   leadingCFindSCPQueryCacheSize = arcdev.leadingCFindSCPQueryCacheSize;
   auditSpoolDirectory = arcdev.auditSpoolDirectory;
   auditPollingInterval = arcdev.auditPollingInterval;
   auditAggregateDuration = arcdev.auditAggregateDuration;
   stowSpoolDirectory = arcdev.stowSpoolDirectory;
   wadoSpoolDirectory = arcdev.wadoSpoolDirectory;
   hl7LogFilePattern = arcdev.hl7LogFilePattern;
   hl7ErrorLogFilePattern = arcdev.hl7ErrorLogFilePattern;
   purgeQueueMessagePollingInterval = arcdev.purgeQueueMessagePollingInterval;
   purgeStgCmtPollingInterval = arcdev.purgeStgCmtPollingInterval;
   purgeStgCmtCompletedDelay = arcdev.purgeStgCmtCompletedDelay;
   hideSPSWithStatusFrom = arcdev.hideSPSWithStatusFrom;
   rejectExpiredStudiesPollingInterval = arcdev.rejectExpiredStudiesPollingInterval;
   rejectExpiredStudiesPollingStartTime = arcdev.rejectExpiredStudiesPollingStartTime;
   rejectExpiredStudiesFetchSize = arcdev.rejectExpiredStudiesFetchSize;
   rejectExpiredSeriesFetchSize = arcdev.rejectExpiredSeriesFetchSize;
   rejectExpiredStudiesAETitle = arcdev.rejectExpiredStudiesAETitle;
   fallbackCMoveSCPStudyOlderThan = arcdev.fallbackCMoveSCPStudyOlderThan;
   storePermissionServiceURL = arcdev.storePermissionServiceURL;
   storePermissionServiceResponsePattern = arcdev.storePermissionServiceResponsePattern;
   storePermissionServiceExpirationDatePattern =
       arcdev.storePermissionServiceExpirationDatePattern;
   storePermissionServiceErrorCommentPattern = arcdev.storePermissionServiceErrorCommentPattern;
   storePermissionServiceErrorCodePattern = arcdev.storePermissionServiceErrorCodePattern;
   storePermissionCacheStaleTimeout = arcdev.storePermissionCacheStaleTimeout;
   storePermissionCacheSize = arcdev.storePermissionCacheSize;
   mergeMWLCacheStaleTimeout = arcdev.mergeMWLCacheStaleTimeout;
   mergeMWLCacheSize = arcdev.mergeMWLCacheSize;
   storeUpdateDBMaxRetries = arcdev.storeUpdateDBMaxRetries;
   allowRejectionForDataRetentionPolicyExpired =
       arcdev.allowRejectionForDataRetentionPolicyExpired;
   acceptMissingPatientID = arcdev.acceptMissingPatientID;
   allowDeleteStudyPermanently = arcdev.allowDeleteStudyPermanently;
   retrieveAETitles = arcdev.retrieveAETitles;
   baseRetrieveURL = arcdev.baseRetrieveURL;
   attributeFilters.clear();
   attributeFilters.putAll(arcdev.attributeFilters);
   metadataFilters.clear();
   metadataFilters.putAll(arcdev.metadataFilters);
   idGenerators.clear();
   idGenerators.putAll(arcdev.idGenerators);
   storageDescriptorMap.clear();
   storageDescriptorMap.putAll(arcdev.storageDescriptorMap);
   queueDescriptorMap.clear();
   queueDescriptorMap.putAll(arcdev.queueDescriptorMap);
   exporterDescriptorMap.clear();
   exporterDescriptorMap.putAll(arcdev.exporterDescriptorMap);
   exportRules.clear();
   exportRules.addAll(arcdev.exportRules);
   rsForwardRules.clear();
   rsForwardRules.addAll(arcdev.rsForwardRules);
   hl7ForwardRules.clear();
   hl7ForwardRules.addAll(arcdev.hl7ForwardRules);
   hl7OrderScheduledStations.clear();
   hl7OrderScheduledStations.addAll(arcdev.hl7OrderScheduledStations);
   hl7OrderSPSStatuses.clear();
   hl7OrderSPSStatuses.putAll(arcdev.hl7OrderSPSStatuses);
   compressionRules.clear();
   compressionRules.addAll(arcdev.compressionRules);
   studyRetentionPolicies.clear();
   studyRetentionPolicies.addAll(arcdev.studyRetentionPolicies);
   attributeCoercions.clear();
   attributeCoercions.addAll(arcdev.attributeCoercions);
   storeAccessControlIDRules.clear();
   storeAccessControlIDRules.addAll(arcdev.storeAccessControlIDRules);
   rejectionNoteMap.clear();
   rejectionNoteMap.putAll(arcdev.rejectionNoteMap);
 }
 public void clearHL7OrderSPSStatuses() {
   hl7OrderSPSStatuses.clear();
 }
Esempio n. 9
0
  private void readTechnique(Statement techStat) throws IOException {
    isUseNodes = false;
    String[] split = techStat.getLine().split(whitespacePattern);

    String name;
    if (split.length == 1) {
      name = TechniqueDef.DEFAULT_TECHNIQUE_NAME;
    } else if (split.length == 2) {
      name = split[1];
    } else {
      throw new IOException("Technique statement syntax incorrect");
    }

    String techniqueUniqueName = materialDef.getAssetName() + "@" + name;
    technique = new TechniqueDef(name, techniqueUniqueName.hashCode());

    for (Statement statement : techStat.getContents()) {
      readTechniqueStatement(statement);
    }

    technique.setShaderPrologue(createShaderPrologue(presetDefines));

    switch (technique.getLightMode()) {
      case Disable:
        technique.setLogic(new DefaultTechniqueDefLogic(technique));
        break;
      case MultiPass:
        technique.setLogic(new MultiPassLightingLogic(technique));
        break;
      case SinglePass:
        technique.setLogic(new SinglePassLightingLogic(technique));
        break;
      case StaticPass:
        technique.setLogic(new StaticPassLightingLogic(technique));
        break;
      case SinglePassAndImageBased:
        technique.setLogic(new SinglePassAndImageBasedLightingLogic(technique));
        break;
      default:
        throw new UnsupportedOperationException();
    }

    List<TechniqueDef> techniqueDefs = new ArrayList<>();

    if (isUseNodes) {
      nodesLoaderDelegate.computeConditions();

      // used for caching later, the shader here is not a file.

      // KIRILL 9/19/2015
      // Not sure if this is needed anymore, since shader caching
      // is now done by TechniqueDef.
      technique.setShaderFile(
          technique.hashCode() + "", technique.hashCode() + "", "GLSL100", "GLSL100");
      techniqueDefs.add(technique);
    } else if (shaderNames.containsKey(Shader.ShaderType.Vertex)
        && shaderNames.containsKey(Shader.ShaderType.Fragment)) {
      if (shaderLanguages.size() > 1) {
        for (int i = 1; i < shaderLanguages.size(); i++) {
          TechniqueDef td = null;
          try {
            td = (TechniqueDef) technique.clone();
          } catch (CloneNotSupportedException e) {
            e.printStackTrace();
          }
          td.setShaderFile(shaderNames, shaderLanguages.get(i));
          techniqueDefs.add(td);
        }
      }
      technique.setShaderFile(shaderNames, shaderLanguages.get(0));
      techniqueDefs.add(technique);

    } else {
      technique = null;
      shaderLanguages.clear();
      shaderNames.clear();
      presetDefines.clear();
      langSize = 0;
      logger.log(Level.WARNING, "Fixed function technique was ignored");
      logger.log(
          Level.WARNING,
          "Fixed function technique ''{0}'' was ignored for material {1}",
          new Object[] {name, key});
      return;
    }

    for (TechniqueDef techniqueDef : techniqueDefs) {
      materialDef.addTechniqueDef(techniqueDef);
    }

    technique = null;
    langSize = 0;
    shaderLanguages.clear();
    shaderNames.clear();
    presetDefines.clear();
  }