public bool Equals(PhysicsPart physicsPart) { if (Part == null) { return(physicsPart == null); } return(Part.Equals(physicsPart)); }
public void RemovePart(PhysicsPart part) { var removeParts = new List <ShadowPart>(); foreach (var shadowPart in ShadowPartList) { if (!part.Equals(shadowPart.Part)) { continue; } removeParts.Add(shadowPart); } foreach (var removePart in removeParts) { ShadowPartList.Remove(removePart); } NumShadowParts -= removeParts.Count; }
public void RemovePart(PhysicsPart part) { // FIXME: null parts if (part == null) { return; } var removeParts = new List <ShadowPart>(); foreach (var shadowPart in ShadowPartList.ToList()) { if (part.Equals(shadowPart)) { removeParts.Add(shadowPart); } } foreach (var removePart in removeParts) { ShadowPartList.Remove(removePart); } }