Package civquest.parser.ruleset

Examples of civquest.parser.ruleset.Field


  private static void addDefinedChanges(Section defSection)
    throws RulesetException, GameChangeException {
    Iterator<Field> iterator = defSection.getFieldIterator();
    while (iterator.hasNext()) {
      Field field = iterator.next();
      GameChangeManager manager = GameChangeManager.
        getGameChangeManager();
      manager.addGameChangeDefinition(field.getName(),
                      field.getStringValue());
    }
  }
View Full Code Here


  private static void addDefinedCategories(Section section)
    throws RulesetException, GameChangeException {
    Iterator<Field> iterator = section.getFieldIterator();
    while (iterator.hasNext()) {
      Field field = iterator.next();
      GameChangeManager manager = GameChangeManager.
        getGameChangeManager();
     
      Set<String> parts = new HashSet<String>();
      for (int n = 0; n < field.getNumberOfValues(); n++) {
        parts.add(field.getStringValue(n));
      }

      manager.addCategoryDefinition(field.getName(), parts);
    }   
  }
View Full Code Here

  private static void addDefinedProvidingRelationships(Section section)
    throws RulesetException, GameChangeException {

    Iterator<Field> iterator = section.getFieldIterator();
    while (iterator.hasNext()) {
      Field field = iterator.next();
      GameChangeManager manager = GameChangeManager.
        getGameChangeManager();
     
      Set<String> parts = new HashSet<String>();
      for (int n = 0; n < field.getNumberOfValues(); n++) {
        parts.add(field.getStringValue(n));
      }

      manager.addProvideDefinition(field.getName(), parts);
    }       
  }
View Full Code Here

                    + section + " has obsolete mode-field.");
    }

    Iterator<Field> iterator = section.getFieldIterator();
    while (iterator.hasNext()) {
      Field field = iterator.next();
      String fieldName = field.getName();
      if (fieldName.equals("Mode")) {
        continue;
      }

      checkListenerRoleSyntax(fieldName);

      String listenerRole = getListenerRole(fieldName);
      boolean before = isBefore(fieldName);
      boolean after = isAfter(fieldName);

      assert before != after;

      for (int n = 0; n < field.getNumberOfValues(); n++) {
        String event = field.getStringValue(n);
        manager.addListener(event, listenerRole,
                  listener, listeningMode, before, after);
      }
    }
  }
View Full Code Here

//       listeningMode = null;
//     }   
   
    Iterator<Field> iterator = section.getFieldIterator();
    while (iterator.hasNext()) {
      Field field = iterator.next();
      String fieldName = field.getName();

      if (fieldName.equals("Mode")) {
        continue;
      }

      checkListenerRoleSyntax(fieldName);     

      String listenerRole = getListenerRole(fieldName);
      boolean before = isBefore(fieldName);
      boolean after = isAfter(fieldName);

      assert before != after;     

      for (int n = 0; n < field.getNumberOfValues(); n++) {
        String event = field.getStringValue(n);
        manager.removeListener(event, listenerRole, listener,
                     listeningMode, before, after);
      }
    }
  } 
View Full Code Here

TOP

Related Classes of civquest.parser.ruleset.Field

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.