Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2020
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1.         Iterator<Particle> iterator = particles.iterator();
  2.         List<String> delete = new ArrayList<>();
  3.         while (iterator.hasNext()) {
  4.  
  5.             Particle p = iterator.next();
  6.             if (delete.contains(p.particleName)) {
  7.                 iterator.remove();
  8.             } else {
  9.                 for (Particle c : particles) {
  10.  
  11.                     if (!c.equals(p)) {
  12.  
  13.                         if (p.locationX.equals(c.locationX) && p.locationY.equals(c.locationY)
  14.                                 && p.locationZ.equals(c.locationZ)) {
  15.  
  16.                            
  17.                            
  18.                             delete.add(c.particleName);
  19.  
  20.                         }
  21.  
  22.                     }
  23.  
  24.                 }
  25.             }
  26.  
  27.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement