Tabnine Logo
FoundingCityBecomesAccessible
Code IndexAdd Tabnine to your IDE (free)

How to use
FoundingCityBecomesAccessible
in
ch.sahits.game.openpatrician.model.event

Best Java code snippets using ch.sahits.game.openpatrician.model.event.FoundingCityBecomesAccessible (Showing top 2 results out of 315)

origin: ch.sahits.game/OpenPatricianClientServerInterface

/**
 * A founded settlement is complete and becomes a town. Thereby it is reachable for anyone.
 * @param city that became a town
 */
public void settlementBecomesTown(ICity city) {
  map.add(city);
  Multimap<IPlayer, ICity> townsInFounding = map.getTownsInFounding();
  for (Iterator<IPlayer> iterator = townsInFounding.keySet().iterator(); iterator.hasNext(); ) {
    IPlayer player =  iterator.next();
    if (townsInFounding.get(player).equals(city)) {
      Collection<ICity> cities = townsInFounding.get(player);
      cities.remove(city);
      if (cities.isEmpty()) {
        iterator.remove();
      }
      break;
    }
  }
  clientServerEventBus.post(new FoundingCityBecomesAccessible(city));
}
origin: ch.sahits.game/OpenPatricianEngine

/**
 * Handle the event where a new city is added to the map.
 * @param event founded city becomes available for trading
 */
@Subscribe
public void handleCityAdd(FoundingCityBecomesAccessible event) {
  ICity city = event.getCity();
  addCity(city);
  CityState cityState = gameFactory.getCityState(city);
  citiesState.addCity(city, cityState);
  cityProductionStorage.add(city);
}
@Subscribe
ch.sahits.game.openpatrician.model.eventFoundingCityBecomesAccessible

Most used methods

  • <init>
  • getCity

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSharedPreferences (Context)
  • putExtra (Intent)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Reference (javax.naming)
  • JButton (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now