Tabnine Logo
MapLoader.getMapName
Code IndexAdd Tabnine to your IDE (free)

How to use
getMapName
method
in
jsettlers.logic.map.loading.MapLoader

Best Java code snippets using jsettlers.logic.map.loading.MapLoader.getMapName (Showing top 10 results out of 315)

origin: jsettlers/settlers-remake

@Override
public String getMapName() {
  return gameName + "(" + mapLoader.getMapName() + ")";
}
origin: jsettlers/settlers-remake

/**
 * Order the maps
 */
protected void sortMaps() {
  Collections.sort(maps, (mapLoader1, mapLoader2) -> {
    int nameComp = mapLoader1.getMapName().compareTo(mapLoader2.getMapName());
    if (nameComp != 0) {
      return nameComp;
    } else {
      return mapLoader1.toString().compareTo(mapLoader2.toString());
    }
  });
}
origin: jsettlers/settlers-remake

/**
 * Checks if a map matches the search criteria
 * 
 * @param m
 *            Map
 * @param search
 *            Criteria
 * @return true if yes, false if no
 */
private boolean matchesSearch(MapLoader m, String search) {
  if (m.getMapName().toLowerCase(Locale.ENGLISH).contains(search)) {
    return true;
  }
  if (m.getDescription().toLowerCase(Locale.ENGLISH).contains(search)) {
    return true;
  }
  return m.getMapId().toLowerCase(Locale.ENGLISH).contains(search);
}
origin: jsettlers/settlers-remake

/**
 * Checks if a map matches the search criteria
 *
 * @param m
 *            Map
 * @param search
 *            Criteria
 * @return true if yes, false if no
 */
private boolean matchesSearch(MapLoader m, String search) {
  if (search.isEmpty()) {
    return true;
  }
  if (m.getMapName().toLowerCase(Locale.ENGLISH).contains(search)) {
    return true;
  }
  if (m.getDescription().toLowerCase(Locale.ENGLISH).contains(search)) {
    return true;
  }
  return m.getMapId().toLowerCase(Locale.ENGLISH).contains(search);
}
origin: jsettlers/settlers-remake

public MapLoader getMapByName(String mapName) {
  ArrayList<MapLoader> maps = new ArrayList<>();
  maps.addAll(getFreshMaps().getItems());
  maps.addAll(getSavedMaps().getItems());
  for (MapLoader curr : maps) {
    if (curr.getMapName().equals(mapName)) {
      return curr;
    }
  }
  return null;
}
origin: jsettlers/settlers-remake

private void prepareUiFor(MapLoader mapLoader) {
  this.mapLoader = mapLoader;
  mapNameLabel.setText(mapLoader.getMapName());
  mapImage.setIcon(new ImageIcon(JSettlersSwingUtil.createBufferedImageFrom(mapLoader)));
  peaceTimeComboBox.removeAllItems();
  peaceTimeComboBox.addItem(EPeaceTime.WITHOUT);
  startResourcesComboBox.removeAllItems();
  J8Arrays.stream(EMapStartResources.values())
      .map(MapStartResourcesUIWrapper::new)
      .forEach(startResourcesComboBox::addItem);
  startResourcesComboBox.setSelectedIndex(EMapStartResources.HIGH_GOODS.value - 1);
  resetNumberOfPlayersComboBox();
  buildPlayerSlots();
  updateNumberOfPlayerSlots();
}
origin: jsettlers/settlers-remake

@Override
public int compareTo(MapLoader other) {
  MapFileHeader myHeader = this.getFileHeader();
  MapFileHeader otherHeader = other.getFileHeader();
  if (myHeader.getType() == otherHeader.getType() && myHeader.getType() == MapType.SAVED_SINGLE) {
    return -this.getCreationDate().compareTo(other.getCreationDate()); // order by date descending
  } else {
    return this.getMapName().compareToIgnoreCase(other.getMapName()); // order by name ascending
  }
}
origin: jsettlers/settlers-remake

private static void createReplayOfRemainingTasks(MapLoader newSavegame, ReplayStartInformation replayStartInformation, String newReplayFile, IGameClock gameClock) throws IOException {
  System.out.println("Creating new jsettlers.integration.replay file (" + newReplayFile + ")...");
  ReplayStartInformation replayInfo = new ReplayStartInformation(0, newSavegame.getMapName(), newSavegame.getMapId(), replayStartInformation.getPlayerId(),
    replayStartInformation.getPlayerSettings()
  );
  DataOutputStream dos = new DataOutputStream(ResourceManager.writeUserFile(newReplayFile));
  replayInfo.serialize(dos);
  gameClock.saveRemainingTasks(dos);
  dos.close();
  System.out.println("New jsettlers.integration.replay file successfully created!");
}
origin: jsettlers/settlers-remake

@Override
public Component getListCellRendererComponent(JList<? extends MapLoader> list, MapLoader value, int index, boolean isSelected,
    boolean cellHasFocus) {
  lbName.setText(value.getMapName().trim());
  String date = "???";
  if (value.getCreationDate() != null) {
origin: jsettlers/settlers-remake

@Override
public Component getListCellRendererComponent(JList<? extends MapLoader> list, MapLoader value, int index, boolean isSelected,
    boolean cellHasFocus) {
  mapNameLabel.setText(value.getMapName());
  String date = "???";
  if (value.getCreationDate() != null) {
jsettlers.logic.map.loadingMapLoadergetMapName

Popular methods of MapLoader

  • getMaxPlayers
  • getCreationDate
  • getFileHeader
  • getLoaderForListedMap
  • getMapData
    Gets the map data for this loader, if the data is available.
  • getMapId
  • getDescription
  • getImage
  • getListedMap
  • getMinPlayers
  • loadMainGrid
  • checkExtention
  • loadMainGrid,
  • checkExtention,
  • getPlayers,
  • isExtensionKnown

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • startActivity (Activity)
  • requestLocationUpdates (LocationManager)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top PhpStorm 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