private Entity FindBubble(Body body) { for (int i = 0; i < entities.Count; i++) { Entity entity = entities[i]; if (entity is Bubble) { Bubble bubble = entity as Bubble; if (bubble.body == body) return bubble; } } return null; }