Package civquest.city

Examples of civquest.city.City


        Field field = this.map.getWorkingField();
        Iterator<Unit> unitsIt = field.getUnitIterator();
        for (;unitsIt.hasNext();) {
            mapObjects.add(unitsIt.next());
        }
        City city = field.getCityOnField();
        if (city != null) {
            mapObjects.add(city);
        }

        if (mapObjects.size() == 1) {
View Full Code Here


  public ResourceAutomation() throws GameChangeException {
    setUpListenerRelationships();
   
    Iterator<City> cityIterator = Game.getMapData().getCityIterator();
    while (cityIterator.hasNext()) {
      City currCity = cityIterator.next();
      initSeqDistributorForCity(currCity);
    }
  }
View Full Code Here

  // Alter sources/consumers of distributions using gamechanges!

  public void calculateConsumers(Nation nation) {
    Iterator<City> cityIterator = nation.getCityIterator();
    while (cityIterator.hasNext()) {
      City city = cityIterator.next();
      cityToDistributor.get(city).calculate();
    }
  }
View Full Code Here

    inStepTwo = false;
 

  public void beforeGameChanged(RemoveCity change) {
    Long cityID = change.getCityID();
    City city = Game.getMapData().getCity(cityID);   
    cityToDistributor.remove(city);
    useDistributor.remove(city);
  }
View Full Code Here

    useDistributor.remove(city);
  }

  public void afterGameChanged(ConstructCity change) {
    Long cityID = change.getCity();
    City city = Game.getMapData().getCity(cityID);
    initSeqDistributorForCity(city);

    if (inStepTwo) {
      calculateSources(city);
      cityToDistributor.get(city).calculate();     
View Full Code Here

   
    Coordinate position = change.getPosition();
    MapData mapData = Game.getMapData();
    Field field = mapData.getField(position);
    Long cityID = change.getCityID();
    City city = mapData.getCity(cityID);

    throw new ResourceGraphException("Re-implement this!");
//     ResourceDistribution distribution = null;
//     ResourceDistribution distribution = city.getResourceDistribution();
View Full Code Here

      // hack to make it run - TODO: think about a more elegant way of
      // mapping model names to the appropriate constructor call
      if (modelName.equals("units_musketeer")) {
        newMapObject = new Musketeer(moLoadedData, step);
      } else if (modelName.equals("city")) {
        newMapObject = new City(moLoadedData, step);
      }
      mapObjects.add(newMapObject);
      newMapObject.setField(this);
    }
  } 
View Full Code Here

            messages.err("ConstructCity", "You try to build a city " +
            "on a field where another nation's city is located.");
            return;
        }

        City city = new City(field, "New City");
    Game.getGame().add(city);
    mapData.setCityOwner(city, nation);
//         mapData.addCity(city, field, nation);

        setCityID(city.getID());
       
      notifyAfter();
  }
View Full Code Here

  public boolean isCityIDAvailable(Coordinate position) {
    return true;
  }

  public Long getCityID(Coordinate position) {
    City city = getField(position).getCityOnField();
    if (city != null) {
      return city.getID();
    } else {
      return null;
    }
  }
View Full Code Here

  public Iterator<Long> getAllCities(Long nation) {
    Set<Long> retCities = new HashSet<Long>();
    Iterator<City> allCitiesIterator = getCityIterator();
    while (allCitiesIterator.hasNext()) {
      City currCity = allCitiesIterator.next();
      if (currCity.getOwner().getID().equals(nation)) {
        retCities.add(currCity.getID());
      }
    }
    return retCities.iterator();     
  }
View Full Code Here

TOP

Related Classes of civquest.city.City

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.