/// <summary> /// Creates a new Lightning user control that will coordinate with a Lightning entity /// </summary> /// <param name="entityId">The ID that will associate the user control with a specific entity.</param> public void CreateNewLightning(int entityId) { LightningControl newLightning = new LightningControl(entityId); DisasterUCDictionary.Add(entityId, newLightning); GameSpace.Children.Add(newLightning); }
public void RemoveControlFromGameSpace(UserControl disaster) { GameSpace.Children.Remove(disaster); int entityId = -1; switch (disaster.Tag.ToString()) { case "lightning": LightningControl lightning = (LightningControl)disaster; entityId = lightning.entityId; break; case "meteor": MeteorControl meteor = (MeteorControl)disaster; entityId = meteor.entityId; break; case "fire": FireControl fire = (FireControl)disaster; entityId = fire.entityId; break; } DisasterUCDictionary.Remove(entityId); }