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

How to use
ECivilisation
in
jsettlers.common.player

Best Java code snippets using jsettlers.common.player.ECivilisation (Showing top 5 results out of 315)

origin: jsettlers/settlers-remake

public void writeTo(DataOutputStream dos) throws IOException {
  dos.writeShort(INITIAL_VERSION);
  dos.writeBoolean(available);
  if (available) {
    dos.writeByte(teamId == null ? -1 : teamId);
    dos.writeUTF(civilisation == null ? "" : civilisation.name());
    dos.writeUTF(playerType == null ? "" : playerType.name());
  }
}
origin: jsettlers/settlers-remake

private static ECivilisation getRandomCivilisation() {
  return ECivilisation.values()[new Random().nextInt(ECivilisation.values().length)];
}
origin: jsettlers/settlers-remake

public static PlayerSetting readFromStream(DataInputStream dis) throws IOException {
  dis.readShort(); // read version
  boolean available = dis.readBoolean();
  if (available) {
    byte readTeamId = dis.readByte();
    Byte teamId = readTeamId == -1 ? null : readTeamId;
    String civilizationName = dis.readUTF();
    ECivilisation civilisation = civilizationName.isEmpty() ? null : ECivilisation.valueOf(civilizationName);
    String playerTypeName = dis.readUTF();
    EPlayerType playerType = playerTypeName.isEmpty() ? null : EPlayerType.valueOf(playerTypeName);
    return new PlayerSetting(true, playerType, civilisation, teamId);
  } else {
    return new PlayerSetting();
  }
}
origin: jsettlers/settlers-remake

  @Override
  public String toString() {
    if (civilisation == null) {
      return Labels.getString("civilisation-random");
    }
    return Labels.getString("civilisation-" + civilisation.name());
  }
}
origin: jsettlers/settlers-remake

private void updateAiPlayerName() {
  if (typeComboBox.getSelectedItem() == null || civilisationComboBox.getSelectedItem() == null) {
    return;
  }
  if (EPlayerType.HUMAN != getPlayerType()) {
    ECivilisation civilisation = getCivilisation();
    if (civilisation != null) {
      setPlayerName(Labels.getString("player-name-" + getCivilisation().name() + "-" + ((PlayerTypeUiWrapper) typeComboBox.getSelectedItem()).getPlayerType().name()));
    } else {
      setPlayerName(Labels.getString("player-name-random"));
    }
    setReady(true);
  } else {
    setReady(false);
  }
}
jsettlers.common.playerECivilisation

Most used methods

  • name
  • valueOf
  • values

Popular in Java

  • Start an intent from android
  • requestLocationUpdates (LocationManager)
  • setScale (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top Vim plugins
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