congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ITradeRouteStop.getTradeStop
Code IndexAdd Tabnine to your IDE (free)

How to use
getTradeStop
method
in
ch.sahits.game.openpatrician.model.map.ITradeRouteStop

Best Java code snippets using ch.sahits.game.openpatrician.model.map.ITradeRouteStop.getTradeStop (Showing top 4 results out of 315)

origin: ch.sahits.game/OpenPatricianClientServerInterface

/**
 * Find trade routes with the <code>city</code> as the second stop.
 * @param city of the second stop of the trade route.
 * @return List of applicable trade routes.
 */
public List<ITradeRoute> findTradeRoutesSecondStop(ICity city) {
  List<ITradeRoute> routes = new ArrayList<>();
  for (ITradeRoute route : map.getTradeRoutes()) {
    List<ITradeRouteStop> stops = new ArrayList<>(route.getTradeStops());
    ICity stopCity = stops.get(1).getTradeStop();
    if (stopCity.equals(city)) {
      routes.add(route);
    }
  }
  return routes;
}
origin: ch.sahits.game/OpenPatricianClientServerInterface

/**
 * Find trade routes with the <code>city</code> as the first stop.
 * @param city of the first stop of the trade route.
 * @return List of applicable trade routes.
 */
public List<ITradeRoute> findTradeRoutesFirstStop(ICity city) {
   List<ITradeRoute> routes = new ArrayList<>();
  for (ITradeRoute route : map.getTradeRoutes()) {
    ITradeRouteStop stop = route.getTradeStops().iterator().next();
    if (stop.getTradeStop().equals(city)) {
      routes.add(route);
    }
  }
  return routes;
}
/**
origin: ch.sahits.game/OpenPatricianEngine

/**
 * {@inheritDoc}<br>
 * Choose the nearest city from the set defined in the trade route.
 * @param vessel that should travel to a city, so that the trade cycle can be reinitialized
 * @return
 */
@Override
public ICity getCityToRestartTradeCycle(INavigableVessel vessel) {
  ITradeMissionData missionData = ((IAIPlayer)vessel.getOwner()).getTradeMission(vessel);
  ITradeRoute route = ((TradeRouteMissionData)missionData).getTradeRoute();
  double distance = Double.MAX_VALUE;
  ICity destination = null;
  for (ITradeRouteStop stop : route.getTradeStops()) {
    double d = vessel.getLocation().distance(stop.getTradeStop().getCoordinates());
    if (d < distance) {
      distance = d;
      destination = stop.getTradeStop();
    }
  }
  return destination;
}
origin: ch.sahits.game/OpenPatricianEngine

  ICity firstCity = ((TradeRouteMissionData) missionData).getTradeRoute().getTradeStops().iterator().next().getTradeStop();
  if (firstCity.equals(city)){
    AggregatesDumpTradeStep dumpStep = createAggregatedDumpStep(vessel, city, loadedWares);
for (Iterator<ITradeRouteStop> iterator = route.getTradeStops().iterator(); iterator.hasNext(); ) {
  ITradeRouteStop routeStop =  iterator.next();
  if (routeStop.getTradeStop().equals(city)){
    stop = routeStop;
    if (iterator.hasNext()) {
      routeStop =  iterator.next();
      nextStop = routeStop.getTradeStop();
    } else {
      nextStop = route.getTradeStops().iterator().next().getTradeStop(); // first
ch.sahits.game.openpatrician.model.mapITradeRouteStopgetTradeStop

Popular methods of ITradeRouteStop

  • getWaresToBuy

Popular in Java

  • Reading from database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onCreateOptionsMenu (Activity)
  • addToBackStack (FragmentTransaction)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JTable (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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