Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Iterator<Particle> iterator = particles.iterator();
- List<String> delete = new ArrayList<>();
- while (iterator.hasNext()) {
- Particle p = iterator.next();
- if (delete.contains(p.particleName)) {
- iterator.remove();
- } else {
- for (Particle c : particles) {
- if (!c.equals(p)) {
- if (p.locationX.equals(c.locationX) && p.locationY.equals(c.locationY)
- && p.locationZ.equals(c.locationZ)) {
- delete.add(c.particleName);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement