Package civquest.nation

Examples of civquest.nation.Nation


  }

  public void afterGameChanged(ActivateNation change) {
    if (change.startStepTwo()) {
      TurnManager turnManager = Game.getGame().getTurnManager();
      Nation currNation = turnManager.getActiveNation();

      assert currNation != null;

      // We fall back to the default (we calculate for the player), since
      // providing a default calculation is no harm
View Full Code Here


    }
  }

  public void afterGameChanged(SetFieldRuledByCity change) {
    TurnManager turnManager = Game.getGame().getTurnManager();
    Nation currNation = turnManager.getActiveNation();
   
    Coordinate position = change.getPosition();
    MapData mapData = Game.getMapData();
    Field field = mapData.getField(position);
    Long cityID = change.getCityID();
View Full Code Here

//       }
//     }
  }

  private boolean cityOwnedByCurrentNation(City city) {
    Nation currNation = Game.getGame().getTurnManager().getActiveNation();
    return currNation.getID().equals(city.getOwner().getID());
  }
View Full Code Here

    Point position = e.getPosition();
   
    if (position != null) {
      Field field = quadMap.getFieldAtPosition(position);
      Nation activeNation = Game.getGame().getActiveNation();
      if (field != null) {
        if (activeNation != null) {
          ConstructUnit newUnitChange
            = new ConstructUnit(field.getPosition(),
                      activeNation.getID());
          newUnitChange.execute();
        } else {
          Messages.getMessages().info("ConstructTestUnit", "QMapWarn",
                        "When constructing test unit: "
                        + "No active nation!");
View Full Code Here

     */
    public void actionPerformed(FunctionActionEvent e) {
//TODO Well, we don't care about the unitCombo. Add this!
        if (this.scenarioEditor.getSelectedTab() == UNIT_TAB) {
            //only proceed if the unitTab is selected
            Nation nation = this.scenarioEditor.getSelectedNation();
            Coordinate coordinate = this.map.getWorkingFieldPos();
            if (coordinate != null) {
                ConstructUnit newUnitChange = new ConstructUnit(
                        coordinate, nation.getID());
                newUnitChange.execute();
            }
        }
    }
View Full Code Here

    super.setPersistentData(step);

    if (step == LoadingStep.CONSTRUCT) {
    } else if (step == LoadingStep.REFERENCE) {
      Long ownerID = loadedData.getLong("owner");
      Nation owner = Game.getGame().getNation(ownerID);
      setOwner(owner);
      owner.addCity(this);
    }
  } 
View Full Code Here

    Registry visRegistry = registry.getSubRegistry("visibility");
   
    this.nations.clear();
    Set<LoadedData> nationSet = loadedData.getLoadedDataHashSet("nations");
    for (LoadedData nationData : nationSet) {
      Nation nation = new Nation(nationRegistry, visRegistry,
                     nationData, step);
      this.add(nation);
    }
  }
View Full Code Here

      notifyBefore();
      Messages messages = Messages.getMessages();
        MapData mapData = Game.getMapData();

        Field field = mapData.getField(location);
        Nation nation = Game.getGame().getNation(ownerNation);

        Iterator<Unit> unitsIt = field.getUnitIterator();
        if (unitsIt.hasNext()) {
            Unit unit = unitsIt.next();
            if (!unit.getOwner().equals(nation)) {
View Full Code Here

  }

  private void constructInitialGroups() {
     Iterator<Nation> iterator = Game.getGame().getNationIterator();
    while (iterator.hasNext()) {
      Nation currNation = iterator.next();
      addDefaultGroup(currNation.getVisibilityManager());
    }

    addDefaultGroup(Game.getGame());
  }
View Full Code Here

  }

  private void constructInitialNationInfos() {
    Iterator<Nation> iterator = Game.getGame().getNationIterator();
    while (iterator.hasNext()) {
      Nation currNation = iterator.next();
      nationPaintInfos.put(currNation.getID(), new NationPaintInfo(nextColor()));
    }
  }
View Full Code Here

TOP

Related Classes of civquest.nation.Nation

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.