public void add(Particle particle, ParticleForceGenerator fg) { ParticleForceRegistration registration = new ParticleForceRegistration(); registration.particle = particle; registration.fg = fg; registrations.Add(registration); }
public void remove(Particle particle, ParticleForceGenerator fg) { if (this.registrations.Count > 0) { ParticleForceRegistration _registration = null; foreach (var registration in this.registrations) { if (registration.particle == particle && registration.fg == fg) { _registration = registration; break; } } if (_registration != null) { this.registrations.Remove(_registration); } } }