Пример #1
0
  /** Reads the general topics from help.yml and adds them to the help index. */
  public synchronized void initializeGeneralTopics() {
    yaml = new HelpYamlReader(server);

    // Initialize general help topics from the help.yml file
    for (HelpTopic topic : yaml.getGeneralTopics()) {
      addTopic(topic);
    }

    // Initialize index help topics from the help.yml file
    for (HelpTopic topic : yaml.getIndexTopics()) {
      if (topic.getName().equals("Default")) {
        defaultTopic = topic;
      } else {
        addTopic(topic);
      }
    }
  }
Пример #2
0
 public synchronized void addTopic(HelpTopic topic) {
   // Existing topics take priority
   if (!helpTopics.containsKey(topic.getName())) {
     helpTopics.put(topic.getName(), topic);
   }
 }
Пример #3
0
 public boolean apply(HelpTopic topic) {
   return topic.getName().charAt(0) == '/';
 }