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

How to use
ICourier
in
ch.sahits.game.openpatrician.model.people

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

origin: ch.sahits.game/OpenPatricianDisplay

@Override
protected EventHandler<MouseEvent> createAcceptHandler() {
  return mouseEvent -> {
    try {
      if (!tavernDialogUtil.noShipWithEnoughCapacityAvailable(city, AMOUNT)) {
        for (IShip ship : city.getPlayersShips()) {
          if (ship.getCapacity() >= AMOUNT * 10) {
            final ICourier courier = (ICourier) currentPerson.get();
            ship.addPassenger(courier);
            CourierPatrolStateInternal patrolState = new CourierPatrolStateInternal(courier.getPremium(), courier.getDestinations());
            IPlayer player = city.getPlayer();
            int minutes = rnd.nextInt(600);
            LocalDateTime postMessage = date.getCurrentDate().plusMinutes(minutes);
            String cityName = patrolState.nextDestination().get().getName();
            taskFactory.getPostponedDisplayMessage(postMessage, "ch.sahits.game.openpatrician.display.dialog.TavernPatrolDialog.acceptMessage", ship.getName(), cityName);
            LocalDateTime firstDeadline = date.getCurrentDate().plusDays(6);
            eventHandlerFactory.getNextCourierPatrolStationHanlder(ship, patrolState.nextDestination().get(), patrolState, player, firstDeadline);
            courier.leave();
            executeOnCloseButtonClicked();
            break;
          }
        }
      }
    } catch (RuntimeException e) {
      logger.error("Failed to accept couriers offer", e);
    }
  };
}
origin: ch.sahits.game/OpenPatricianEngine

if (person instanceof ICourier) {
  ICourier courier = (ICourier) person;
  courier.setName(firstNameLoader.getRandomName() + " " + lastNameLoader.getRandomName());
  courier.setPremium(rnd.nextInt(2000) + 4300);
  int nbDestinations = rnd.nextInt(3) + 3;
  ICity[] destinations = new ICity[nbDestinations];
  courier.setDestinations(destinations);
  fillDestinations(city, destinations);
  courier.setCurrentDestIndex(0);
} else if (person instanceof ITransportTrader) {
  ITransportTrader transportTrader = (ITransportTrader) person;
ch.sahits.game.openpatrician.model.peopleICourier

Most used methods

  • getDestinations
  • getPremium
  • leave
  • setCurrentDestIndex
  • setDestinations
  • setName
  • setPremium

Popular in Java

  • Reactive rest calls using spring rest template
  • getResourceAsStream (ClassLoader)
  • getSupportFragmentManager (FragmentActivity)
  • addToBackStack (FragmentTransaction)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top 25 Plugins for Webstorm
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