Codota Logo
ELandscapeType.ordinal
Code IndexAdd Codota to your IDE (free)

How to use
ordinal
method
in
jsettlers.common.landscape.ELandscapeType

Best Java code snippets using jsettlers.common.landscape.ELandscapeType.ordinal (Showing top 3 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: jsettlers/settlers-remake

/**
 * Gets an array of landscapes that can be used to fade between one landscape type and the other. Contains the first and last landscape (or only
 * one element if the landscape is the same.
 * <p>
 * Returns null if there is no way the landscapes can be faded.
 * 
 * @param l1
 * @param l2
 * @return
 */
public ELandscapeType[] getLandscapesBetween(ELandscapeType l1,
    ELandscapeType l2) {
  ELandscapeType[] buffered =
      fadeLandscapesBuffer[l1.ordinal()][l2.ordinal()];
  if (buffered == null) {
    computeLandscapesFrom(l1);
    buffered = fadeLandscapesBuffer[l1.ordinal()][l2.ordinal()];
    // int length = buffered.length;
    // ELandscapeType[] reverse = new ELandscapeType[length];
    // for (int i = 0; i < length; i++) {
    // reverse[i] = buffered[length - 1 - i];
    // }
    // fadeLandscapesBuffer[l2.ordinal()][l1.ordinal()] = reverse;
  }
  return buffered;
}
origin: jsettlers/settlers-remake

private void computeLandscapesFrom(ELandscapeType l1) {
  System.out.println("Starting to compute fades from " + l1.toString());
  ELandscapeType[][] ways = fadeLandscapesBuffer[l1.ordinal()];
  ways[l1.ordinal()] = new ELandscapeType[] {
      l1
  };
  boolean foundnew = true;
  while (foundnew) {
    foundnew = false;
    for (FadableLandscapes f : allowed) {
      int ordinal1 = f.getL1().ordinal();
      int ordinal2 = f.getL2().ordinal();
      if (ways[ordinal1] == null && ways[ordinal2] != null) {
        ways[ordinal1] = add(ways[ordinal2], f.getL1());
        foundnew = true;
      }
      if (ways[ordinal2] == null && ways[ordinal1] != null) {
        ways[ordinal2] = add(ways[ordinal1], f.getL2());
        foundnew = true;
      }
    }
  }
}
origin: jsettlers/settlers-remake

stream.writeByte(data.getLandscape(x, y).ordinal());
jsettlers.common.landscapeELandscapeTypeordinal

Popular methods of ELandscapeType

  • isWater
    Checks if this landscape type is water (not river, just water that ships can swim on.). To check for
  • getColor
    Gets the base color of the landscape
  • getImageNumber
  • hashCode
  • isGrass
  • isRiver
  • name
  • toString
  • valueOf

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onCreateOptionsMenu (Activity)
  • findViewById (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Stack (java.util)
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with
  • JFrame (javax.swing)
  • Join (org.hibernate.mapping)
  • Option (scala)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now