Пример #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="child">tower being upgraded</param>
        /// <param name="level">level the tower is in</param>
        /// <param name="x">horizontal coordinate</param>
        /// <param name="y">vertical coordinate</param>
        public Upgrade(Tower child, Level level, int x, int y)
        {
            InitializeComponent();

            this.level = level;
            this.x = x;
            this.y = y;

            List<Tower> upgrades = level.GetUpgrades(child);
            foreach (Tower t in upgrades)
                upgradeComboBox.Items.Add(t.name);
            upgradeComboBox.SelectedIndex = 0;
            UpdateLabels();

            childAoeLabel.Content = child.aoeRadius > 0 ? child.aoeRadius + " (" + child.aoeDamage + "%)" : "None";
            childDamageLabel.Content = child.damage;
            childDelayLabel.Content = child.delay;
            childRangeLabel.Content = child.range;
            childStatusLabel.Content = child.status;
        }