public void AddGum(Gum g) { this.Gum = g; this.OnPropertyChanged(new PropertyChangedEventArgs("Gum")); this.OnPropertyChanged(new PropertyChangedEventArgs("Source")); this.OnPropertyChanged(new PropertyChangedEventArgs("InnerSource")); }
public Gum(GumColours colour, Gum innerGum) { this.Colour = colour; this.InnerGum = innerGum; // Sets the image source switch (this.Colour) { case GumColours.Red: this.Source = "/Gumshoe;component/GFX/RedGum.png"; break; case GumColours.Blue: this.Source = "/Gumshoe;component/GFX/BlueGum.png"; break; case GumColours.Green: this.Source = "/Gumshoe;component/GFX/GreenGum.png"; break; case GumColours.Orange: this.Source = "/Gumshoe;component/GFX/OrangeGum.png"; break; default: break; } }
public void InitializeGQueue(int lvl) { //set this number based on level int numElements = levelQueueAmount[lvl]; Random random = new Random(); int colourNum; int innerColourNum; for (int i = 0; i < numElements; i++) { //randomly pick a colour colourNum = (int)Math.Floor(random.NextDouble() * 4); Gum innerGum = null; // TODO, set back to 4 if (lvl >= 1) { innerColourNum = (int)Math.Floor(random.NextDouble() * 4); if (colourNum != innerColourNum) { innerGum = new Gum((GumColours)innerColourNum, null); } } this.GQueue.Add(new Gum((GumColours)colourNum, innerGum)); } }