Esempio n. 1
0
        /// <summary>
        /// Creates a new Fire user contorl that will coordinate with a Fire entity
        /// </summary>
        /// <param name="entityId">The ID that will associate the user control with a specific entity.</param>
        public void CreateNewFire(int entityId)
        {
            FireControl newFire = new FireControl(entityId);

            DisasterUCDictionary.Add(entityId, newFire);
            GameSpace.Children.Add(newFire);
        }
Esempio 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);
        }