Relationship between BubbleSprite and BubbleManager class - ViralKaos/Frozen-Bubble-Android-port-x86 GitHub Wiki
public class BubbleSprite extends Sprite { … private BubbleManager bubbleManager; … // Class constructor used when restoring the game state from a bundle.public BubbleSprite(…, BubbleManager bubbleManager, …) {…this.bubbleManager = bubbleManager;… } //Class constructor used when creating a launched bubble.public BubbleSprite(…, BubbleManager bubbleManager, SoundManager …) {…this.bubbleManager = bubbleManager;… } //Class constructor used when initializing a new level. public BubbleSprite(… , BubbleManager bubbleManager, …) {super(area);…this.bubbleManager = bubbleManager;…addToManager(); } public void addToManager() {bubbleManager.addBubble(bubbleFace); } public void removeFromManager() {bubbleManager.removeBubble(bubbleFace); }}public class BubbleManager {…public void addBubble(BmpWrap bubble) {countBubbles[findBubble(bubble)]++;bubblesLeft++; } public void removeBubble(BmpWrap bubble) {countBubbles[findBubble(bubble)]--;bubblesLeft--;}...}