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

How to use
SettlersVersionMapping
in
jsettlers.graphics.image.reader.versions

Best Java code snippets using jsettlers.graphics.image.reader.versions.SettlersVersionMapping (Showing top 6 results out of 315)

origin: jsettlers/settlers-remake

public static SettlersVersionMapping readFromDirectory(String directory) throws IOException {
  File file = new File(directory, MAPPING_FILE_NAME);
  if (file.exists()) {
    return readFromStream(new FileInputStream(file));
  } else {
    return new SettlersVersionMapping();
  }
}
origin: jsettlers/settlers-remake

  public static GfxFolderMapping getMappingForVersionId(String settlersVersionId) {
    try {
      SettlersVersionMapping mappingFile = readFromStream(SettlersVersionMapping.class.getResourceAsStream(MAPPING_FILE_NAME));
      return mappingFile.getMapping(settlersVersionId);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
}
origin: jsettlers/settlers-remake

public void serializeToDirectory(String directory) throws IOException {
  serializeToStream(new FileOutputStream(new File(directory, MAPPING_FILE_NAME)));
}
origin: jsettlers/settlers-remake

/**
 * Sets the path to look for dat files.
 *
 * @param path
 *         The directory. It may not exist, but must not be null.
 */
public static void setLookupPath(File path, String settlersVersionId) {
  ImageProvider.lookupPath = path;
  getInstance().gfxFolderMapping = SettlersVersionMapping.getMappingForVersionId(settlersVersionId);
  getInstance().startPreloading();
}
origin: jsettlers/settlers-remake

@Test
public void testGetAmazonDemoMapping() {
  GfxFolderMapping mapping = SettlersVersionMapping.getMappingForVersionId(Long.toString(-1282419180527137435L));
  assertNotNull(mapping);
  assertTrue(mapping instanceof IndexingGfxFolderMapping);
}
origin: jsettlers/settlers-remake

  @Test
  public void testGetMappingForUnknownHash() {
    GfxFolderMapping mapping = SettlersVersionMapping.getMappingForVersionId(Long.toString(-1L));

    assertNotNull(mapping);
    assertTrue(mapping instanceof DefaultGfxFolderMapping);
  }
}
jsettlers.graphics.image.reader.versionsSettlersVersionMapping

Most used methods

  • getMappingForVersionId
  • <init>
  • getMapping
  • readFromStream
  • serializeToStream

Popular in Java

  • Reading from database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • notifyDataSetChanged (ArrayAdapter)
  • String (java.lang)
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • JComboBox (javax.swing)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Github Copilot alternatives
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