Skip to content

Commit

Permalink
EnumSet utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed Jun 7, 2024
1 parent 3cb45ab commit 7138ef8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arc-core/src/arc/struct/EnumSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,12 @@ public EnumSet<T> with(T add){
public boolean contains(T t){
return (mask & (1 << t.ordinal())) != 0;
}

public boolean containsAny(EnumSet<T> other){
return (mask & other.mask) != 0;
}

public boolean containsAll(EnumSet<T> other){
return (mask & other.mask) == other.mask;
}
}

0 comments on commit 7138ef8

Please sign in to comment.