congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
BitVector.isEmpty
Code IndexAdd Tabnine to your IDE (free)

How to use
isEmpty
method
in
com.artemis.utils.BitVector

Best Java code snippets using com.artemis.utils.BitVector.isEmpty (Showing top 17 results out of 315)

origin: junkdog/artemis-odb

/**
 * Returns whether this Aspect would accept the given set.
 */
public boolean isInterested(BitVector componentBits){
  // Check if the entity possesses ALL of the components defined in the aspect.
  if(!allSet.isEmpty() && !componentBits.containsAll(allSet))
    return false;
  // If we are STILL interested,
  // Check if the entity possesses ANY of the exclusion components,
  // if it does then the system is not interested.
  if (!exclusionSet.isEmpty() && exclusionSet.intersects(componentBits))
    return false;
  // If we are STILL interested,
  // Check if the entity possesses ANY of the components in the oneSet.
  // If so, the system is interested.
  if (!oneSet.isEmpty() && !oneSet.intersects(componentBits))
    return false;
  return true;
}
origin: junkdog/artemis-odb

void informEntityChanges() {
  if (insertedIds.isEmpty() && removedIds.isEmpty())
    return;
  transferBitsToInts(extra.inserted, extra.removed);
  extra.informEntityChanges();
  entities.setSize(0);
}
origin: junkdog/artemis-odb

void update() {
  while(!changed.isEmpty() || !deleted.isEmpty()) {
    asm.process(changed, deleted);
    purgeComponents();
  }
  clean();
}
origin: net.onedaybeard.artemis/artemis-odb

/**
 * Returns whether this Aspect would accept the given set.
 */
public boolean isInterested(BitVector componentBits){
  // Check if the entity possesses ALL of the components defined in the aspect.
  if(!allSet.isEmpty() && !componentBits.containsAll(allSet))
    return false;
  // If we are STILL interested,
  // Check if the entity possesses ANY of the exclusion components,
  // if it does then the system is not interested.
  if (!exclusionSet.isEmpty() && exclusionSet.intersects(componentBits))
    return false;
  // If we are STILL interested,
  // Check if the entity possesses ANY of the components in the oneSet.
  // If so, the system is interested.
  if (!oneSet.isEmpty() && !oneSet.intersects(componentBits))
    return false;
  return true;
}
origin: net.onedaybeard.artemis/artemis-odb

void informEntityChanges() {
  if (insertedIds.isEmpty() && removedIds.isEmpty())
    return;
  transferBitsToInts(extra.inserted, extra.removed);
  extra.informEntityChanges();
  entities.setSize(0);
}
origin: net.onedaybeard.artemis/artemis-odb

void update() {
  while(!changed.isEmpty() || !deleted.isEmpty()) {
    asm.process(changed, deleted);
    purgeComponents();
  }
  clean();
}
origin: junkdog/artemis-odb

@Override
void mark(int entityId) {
  if (idBits.isEmpty()) // see cm#clean
    batchProcessor.purgatories.add(this);
  idBits.set(entityId);
}
origin: net.onedaybeard.artemis/artemis-odb

/**
 * Returns a reference to the bag holding all matched entities.
 *
 * <p><b>Warning: </b> Never remove elements from the bag, as this
 * will lead to undefined behavior.</p>
 *
 * @return View of all active entities.
 */
public IntBag getEntities() {
  if (entities.isEmpty() && !activeEntityIds.isEmpty())
    rebuildCompressedActives();
  return entities;
}
origin: net.onedaybeard.artemis/artemis-odb

@Override
void mark(int entityId) {
  if (idBits.isEmpty()) // see cm#clean
    batchProcessor.purgatories.add(this);
  idBits.set(entityId);
}
origin: junkdog/artemis-odb

/**
 * Returns a reference to the bag holding all matched entities.
 *
 * <p><b>Warning: </b> Never remove elements from the bag, as this
 * will lead to undefined behavior.</p>
 *
 * @return View of all active entities.
 */
public IntBag getEntities() {
  if (entities.isEmpty() && !activeEntityIds.isEmpty())
    rebuildCompressedActives();
  return entities;
}
origin: junkdog/artemis-odb

/**
 * Returns whether this Aspect would accept the given set.
 */
public boolean isInterested(BitVector componentBits){
  // Check if the entity possesses ALL of the components defined in the aspect.
  if(!allSet.isEmpty()) {
    for (int i = allSet.nextSetBit(0); i >= 0; i = allSet.nextSetBit(i+1)) {
      if(!componentBits.get(i)) {
        return false;
      }
    }
  }
  // If we are STILL interested,
  // Check if the entity possesses ANY of the exclusion components,
  // if it does then the system is not interested.
  if (!exclusionSet.isEmpty() && exclusionSet.intersects(componentBits))
    return false;
  // If we are STILL interested,
  // Check if the entity possesses ANY of the components in the oneSet.
  // If so, the system is interested.
  if (!oneSet.isEmpty() && !oneSet.intersects(componentBits))
    return false;
  return true;
}
origin: junkdog/artemis-odb

/**
 * Decodes the set bits as integers. The destination
 * {@link IntBag} is reset before the bits are transposed.
 *
 * @param out decoded ints end up here
 * @return Same as out
 */
public IntBag toIntBag(IntBag out) {
  if (isEmpty()) {
    out.setSize(0);
    return out;
  }
  int count = prepareBag(out, 1);
  int[] data = out.getData();
  for (int i = 0, index = 0; count > index; i++) {
    long bitset = words[i];
    int wordBits = i << 6;
    while (bitset != 0) {
      long t = bitset & -bitset;
      data[index] = wordBits + Long.bitCount(t - 1);
      bitset ^= t;
      index++;
    }
  }
  return out;
}
origin: net.onedaybeard.artemis/artemis-odb

/**
 * Decodes the set bits as integers. The destination
 * {@link IntBag} is reset before the bits are transposed.
 *
 * @param out decoded ints end up here
 * @return Same as out
 */
public IntBag toIntBag(IntBag out) {
  if (isEmpty()) {
    out.setSize(0);
    return out;
  }
  int count = prepareBag(out, 1);
  int[] data = out.getData();
  for (int i = 0, index = 0; count > index; i++) {
    long bitset = words[i];
    int wordBits = i << 6;
    while (bitset != 0) {
      long t = bitset & -bitset;
      data[index] = wordBits + Long.bitCount(t - 1);
      bitset ^= t;
      index++;
    }
  }
  return out;
}
origin: junkdog/artemis-odb

/**
 * Decodes the set bits as pairs of <code>entity id</code> and
 * {@link World#compositionId(int) compositionId}. The
 * destination{@link IntBag} is reset before the bits are
 * transposed.
 *
 * @param out decoded ints end up here
 * @return Same as out
 */
public IntBag toIntBagIdCid(ComponentManager cm, IntBag out) {
  if (isEmpty()) {
    out.setSize(0);
    return out;
  }
  int count = prepareBag(out, 2);
  int[] data = out.getData();
  for (int i = 0, index = 0; count > index; i++) {
    long bitset = words[i];
    int wordBits = i << 6;
    while (bitset != 0) {
      long t = bitset & -bitset;
      int id = wordBits + Long.bitCount(t - 1);
      data[index] = id;
      data[index + 1] = cm.getIdentity(id);
      index += 2;
      bitset ^= t;
    }
  }
  return out;
}
origin: junkdog/artemis-odb

/**
 * Decodes the set bits as integers. The destination
 * {@link IntBag} is reset before the bits are transposed.
 *
 * @param out decoded ints end up here
 * @return Same as out
 */
public IntBag toIntBag(IntBag out) {
  out.setSize(0);
  if (isEmpty())
    return out;
  for (int id = nextSetBit(0); id >= 0; id = nextSetBit(id + 1)) {
    out.add(id);
  }
  return out;
}
origin: net.onedaybeard.artemis/artemis-odb

/**
 * Decodes the set bits as pairs of <code>entity id</code> and
 * {@link World#compositionId(int) compositionId}. The
 * destination{@link IntBag} is reset before the bits are
 * transposed.
 *
 * @param out decoded ints end up here
 * @return Same as out
 */
public IntBag toIntBagIdCid(ComponentManager cm, IntBag out) {
  if (isEmpty()) {
    out.setSize(0);
    return out;
  }
  int count = prepareBag(out, 2);
  int[] data = out.getData();
  for (int i = 0, index = 0; count > index; i++) {
    long bitset = words[i];
    int wordBits = i << 6;
    while (bitset != 0) {
      long t = bitset & -bitset;
      int id = wordBits + Long.bitCount(t - 1);
      data[index] = id;
      data[index + 1] = cm.getIdentity(id);
      index += 2;
      bitset ^= t;
    }
  }
  return out;
}
origin: junkdog/artemis-odb

/**
 * Decodes the set bits as pairs of <code>entity id</code> and
 * {@link World#compositionId(int) compositionId}. The
 * destination{@link IntBag} is reset before the bits are
 * transposed.
 *
 * @param out decoded ints end up here
 * @return Same as out
 */
public IntBag toIntBagIdCid(ComponentManager cm, IntBag out) {
  out.setSize(0);
  if (isEmpty())
    return out;
  for (int id = nextSetBit(0); id >= 0; id = nextSetBit(id + 1)) {
    out.add(id);
    out.add(cm.getIdentity(id));
  }
  return out;
}
com.artemis.utilsBitVectorisEmpty

Popular methods of BitVector

  • get
  • clear
  • nextSetBit
    Returns the index of the first bit that is set to true that occurs on or after the specified startin
  • set
  • <init>
  • cardinality
  • equals
  • intersects
    Returns true if the specified BitVector has any bits set to true that are also set to true in this B
  • length
    Returns the "logical size" of this bitset: the index of the highest set bit in the bitset plus one.
  • or
    Performs a logical OR of this bit set with the bit set argument. This bit set is modified so that a
  • toIntBag
    Decodes the set bits as integers. The destination IntBag is reset before the bits are transposed.
  • unsafeGet
  • toIntBag,
  • unsafeGet,
  • andNot,
  • bitIndex,
  • bitOffset,
  • checkCapacity,
  • checkIndex,
  • checkRange,
  • clone

Popular in Java

  • Parsing JSON documents to java classes using gson
  • putExtra (Intent)
  • notifyDataSetChanged (ArrayAdapter)
  • setRequestProperty (URLConnection)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • 14 Best Plugins for Eclipse
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