Add idEquals to NPCQuery

This commit is contained in:
roweyman
2017-06-15 23:50:57 +02:00
parent a6372f0ee9
commit 704727a0de

View File

@@ -40,4 +40,21 @@ public class NPCQuery extends ActorQuery<NPC, NPCQuery>
.filter(predicate)
.toArray(NPC[]::new);
}
@SuppressWarnings("unchecked")
public NPCQuery idEquals(int... ids)
{
predicate = and(object ->
{
for (int id : ids)
{
if (object.getId() == id)
{
return true;
}
}
return false;
});
return (NPCQuery) this;
}
}