Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new Meteor user control that will coordinate with a Meteor entity
        /// </summary>
        /// <param name="entityId">The ID that will associate the user control with a specific entity.</param>
        public void CreateNewMeteor(int entityId)
        {
            MeteorControl newMeteor = new MeteorControl(entityId);

            DisasterUCDictionary.Add(entityId, newMeteor);
            GameSpace.Children.Add(newMeteor);
        }
Ejemplo n.º 2
0
        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);
        }