using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace WTD_Editor
{
    public class Tower
    {
        // inner class Special
        public class Special 
        {
            public int type;
            public int param1;
            public int param2;
            public int param3;

            public Special()
            {
                type = 1;
                param1 = 0;
                param2 = 0;
                param3 = 0;
            }
        }

        // attributes
        public int usedby;
        public string name;
        public string desc;
        public int pal;
        public int gfx_idx;
        public int icon_idx;
        public int attack_type;
        public int sound;
        public int price;
        public int min_damage;
        public int max_damage;
        public int speed;
        public int reload;
        public int range;
        public bool air;
        public bool ground;
        public bool dark;
        public int evo_min;
        public List<Special> specials;
        [XmlIgnore]
        public List<Tower> upgrades;
        public List<int> upgrades_idx;

        // constructor
        public Tower()
        {
            usedby = 0;
            name = "";
            desc = "";
            pal = (int)Map.T_PAL.NORMAL;
            gfx_idx = 0;
            icon_idx = 28;
            attack_type = (int)Map.ATTACKS.ARROW;
            sound = 0;
            price = 0;
            min_damage = 0;
            max_damage = 0;
            speed = (int)Map.A_SPEED.NORMAL;
            reload = (int)Map.A_RELOAD.STANDARD;
            range = (int)Map.A_RANGE.AVERAGE;
            air = true;
            ground = true;
            dark = false;
            evo_min = 0;
            specials = new List<Special>();
            upgrades = new List<Tower>();
            upgrades_idx = new List<int>();
        }

        override public string ToString()
        {
            return this.name;
        }
    }
}
