Package civquest.parser.ruleset

Examples of civquest.parser.ruleset.Section


  public Session(Registry guiRegistry) throws RulesetException {
    this.guiRegistry = guiRegistry;
    Ruleset listenerRuleset = guiRegistry.getSubRegistry("main").
      getRuleset(".listens");
    Section listenerSection = listenerRuleset.
      getSection("session_listens");

    try {
      RulesetGameChangeLoader.addListener(listenerSection, this,
                        GameChangeManager.Listening.ALL_NATIONS);
View Full Code Here


          guiChange.execute();
        }
      };

    Ruleset generalRuleset = guiRegistry.getRuleset("general");
    Section settingsRuleset = generalRuleset.getSection("settings");
    int blinkInterval = settingsRuleset.getField("unitBlinkInterval").getIntValue();
    guiState.startUnitBlinkTimer(blinkInterval, blinkListener);
  }
View Full Code Here

  private void loadBasicAmounts() throws ConfigurationException {
    Ruleset basicRuleset = resourceRegistry.getRuleset("basic");
    Iterator<Section> sectionIterator = basicRuleset.getSectionIterator();
    while (sectionIterator.hasNext()) {
      Section section = sectionIterator.next();
      String sectionName = section.getName();
      mapConfig.checkHeightVegSectionName(sectionName);
      Field.Height height = mapConfig.getHeightFromSectionName(sectionName);
      String vegetation = mapConfig.getVegetationFromSectionName(sectionName);
      loadBasicAmounts(section, height, vegetation);
    }
View Full Code Here

    return firstSubSet.getSubImageSet(widthString + "x" + heightString);
  }

  private void constructBasicFieldViews(GameDataAccessor gameData) throws RulesetException {
    Ruleset ruleset = registry.getRuleset("LayeredFieldView");
    Section basicFVSection = ruleset.getSection("BasicFieldViews");
   
    // Casts safe because addFieldView returns its argument
    civquest.parser.ruleset.Field terrainField = basicFVSection.getField("TerrainView");
    terrainView = (TerrainView)addFieldView(constructTerrainView(terrainField, gameData));
    civquest.parser.ruleset.Field cityField = basicFVSection.getField("CityView");
    cityView = (CityView)addFieldView(constructCityView(cityField, gameData));
    civquest.parser.ruleset.Field unitField = basicFVSection.getField("UnitView");
    unitView = (UnitView)addFieldView(constructUnitView(unitField, gameData));
   
  }
View Full Code Here

//     }

  private void loadConfiguration(Registry registry) throws RulesetException {
    Registry mapRegistry = registry.getSubRegistry("map");
    Ruleset isoRuleset = mapRegistry.getRuleset("iso");
    Section distSection = isoRuleset.getSection("distances");
    diagonalDistance = distSection.getField("diagonal").getIntValue();
    straightDistance = distSection.getField("straight").getIntValue();
  }
View Full Code Here

    String vegName = overlapManager.getVegetation(position, direction);
    Field.Height heightLevel = overlapManager.getHeightLevel(position, direction);

    if (vegName != null) {
      Section matchingSection = getOverlapSection(vegName, heightLevel);
     
      if (matchingSection == null) {
        images[index] = null;
      } else {
        FieldReader fieldReader = gameData.getFieldReader();
View Full Code Here

  }

  private Section getOverlapSection(String vegetationName, Field.Height heightLevel) {
    Iterator iterator = overlapRuleset.getSectionIterator();
    while (iterator.hasNext()) {
      Section currSection = (Section)(iterator.next());
      if (sectionMatchesForOverlapping(currSection, vegetationName, heightLevel)) {
        return currSection;
      }
    }
    return null;
View Full Code Here

  public RandomTerrainOverlapManager(GameDataAccessor gameData, Registry overlapRegistry)
    throws RulesetException {
    reset(gameData);
   
    Ruleset ruleset = overlapRegistry.getRuleset("randomTerrainManager");
    Section listenerSection = ruleset.getSection("listens");

    try {
      RulesetGameChangeLoader.addListener(listenerSection, this);
     } catch (GameChangeException e) {
       Messages.getMessages().err("RTOverlapManager", "Error when setting up listeners: "
View Full Code Here

    }
    return retValue;
  }

  private void afterUnitsMarked() throws RulesetException {
    Section allListenerSection
      = ruleset.getSection("listensItselfIfUnitsMarkedAN");
    Section  currListenerSection
      = ruleset.getSection("listensItselfIfUnitsMarkedCN");

    try {
      RulesetGameChangeLoader.addListener(allListenerSection, this,
                        GameChangeManager.Listening.ALL_NATIONS);
View Full Code Here

    listensIfUnitsMarked = true;
  }

  private void afterUnitsUnmarked() throws RulesetException {
    Section allListenerSection
      = ruleset.getSection("listensItselfIfUnitsMarkedAN");
    Section currListenerSection
      = ruleset.getSection("listensItselfIfUnitsMarkedCN");

    try {
      RulesetGameChangeLoader.removeListener(allListenerSection, this,
                           GameChangeManager.Listening.ALL_NATIONS);
View Full Code Here

TOP

Related Classes of civquest.parser.ruleset.Section

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.