Example usage for com.badlogic.gdx.utils Bits containsAll

List of usage examples for com.badlogic.gdx.utils Bits containsAll

Introduction

In this page you can find the example usage for com.badlogic.gdx.utils Bits containsAll.

Prototype

public boolean containsAll(Bits other) 

Source Link

Document

Returns true if this bit set is a super set of the specified set, i.e.

Usage

From source file:com.badlogic.ashley.core.Family.java

License:Apache License

/** @return Whether the entity matches the family requirements or not */
public boolean matches(Entity entity) {
    Bits entityComponentBits = entity.getComponentBits();

    if (!entityComponentBits.containsAll(all)) {
        return false;
    }//from   w ww. j  a  v a 2  s.co m

    if (!one.isEmpty() && !one.intersects(entityComponentBits)) {
        return false;
    }

    if (!exclude.isEmpty() && exclude.intersects(entityComponentBits)) {
        return false;
    }

    return true;
}