private void Clear()
        {
            champion.Damage    = 0;
            champion.Speed     = 0;
            champion.MinRNG    = 1;
            champion.MaxRNG    = 1;
            champion.Defense   = 0;
            champion.HitPoints = 0;
            champion.Size      = 1;

            champion.AllAbilities_refs.Clear();

            loaded_champion_ref = null;

            UpdateControls();
        }
        private void LoadFromChampions_Click(object sender, EventArgs e)
        {
            int champ_id = -1;

            foreach (var ch in Program.database.Champions)
            {
                if (ch.Value.Name == ChampionTemplate.Text)
                {
                    champ_id = ch.Key;
                    break;
                }
            }

            if (champ_id == -1)
            {
                return;
            }

            Pox.Champion base_champ = Program.database.Champions[champ_id];

            champion.Damage    = base_champ.Damage;
            champion.Speed     = base_champ.Speed;
            champion.MinRNG    = base_champ.MinRNG;
            champion.MaxRNG    = base_champ.MaxRNG;
            champion.Defense   = base_champ.Defense;
            champion.HitPoints = base_champ.HitPoints;
            champion.Size      = base_champ.Size;

            champion.AllAbilities_refs.Clear();

            foreach (var ab in base_champ.BaseAbilities_refs)
            {
                champion.AllAbilities_refs.Add(ab);
            }

            int up1 = base_champ.Upgrade1[base_champ.DefaultUpgrade1Index];

            champion.AllAbilities_refs.Add(Program.database.Abilities[up1]);

            int up2 = base_champ.Upgrade2[base_champ.DefaultUpgrade2Index];

            champion.AllAbilities_refs.Add(Program.database.Abilities[up2]);

            loaded_champion_ref = base_champ;

            UpdateControls();
        }
        private void LoadChampionChangeInfo(Pox.Champion prev_champion, Pox.Champion curr_champion)
        {
            LoadRuneChangeInfo(prev_champion, curr_champion);

            if ((prev_champion.MinRNG != curr_champion.MinRNG) || (prev_champion.MaxRNG != curr_champion.MaxRNG))
            {
                PushChangeInfo(string.Format("Range changed from {0}-{1} to {2}-{3}", prev_champion.MinRNG, prev_champion.MaxRNG, curr_champion.MinRNG, curr_champion.MaxRNG));
            }
            if (prev_champion.Defense != curr_champion.Defense)
            {
                PushChangeInfo(string.Format("Defense changed from {0} to {1}", prev_champion.Defense, curr_champion.Defense));
            }
            if (prev_champion.HitPoints != curr_champion.HitPoints)
            {
                PushChangeInfo(string.Format("Hit points changed from {0} to {1}", prev_champion.HitPoints, curr_champion.HitPoints));
            }
            if (prev_champion.Damage != curr_champion.Damage)
            {
                PushChangeInfo(string.Format("Damage changed from {0} to {1}", prev_champion.Damage, curr_champion.Damage));
            }
            if (prev_champion.Speed != curr_champion.Speed)
            {
                PushChangeInfo(string.Format("Speed changed from {0} to {1}", prev_champion.Speed, curr_champion.Speed));
            }
            if (prev_champion.Size != curr_champion.Size)
            {
                PushChangeInfo(string.Format("Size changed from {0}x{1} to {2}x{3}", prev_champion.Size, prev_champion.Size, curr_champion.Size, curr_champion.Size));
            }
            foreach (string c in prev_champion.Class)
            {
                if (!(curr_champion.Class.Contains(c)))
                {
                    PushChangeInfo(string.Format("Class removed: {0}", c));
                }
            }
            foreach (string c in curr_champion.Class)
            {
                if (!(prev_champion.Class.Contains(c)))
                {
                    PushChangeInfo(string.Format("Class added: {0}", c));
                }
            }
            foreach (string r in prev_champion.Race)
            {
                if (!(curr_champion.Race.Contains(r)))
                {
                    PushChangeInfo(string.Format("Race removed: {0}", r));
                }
            }
            foreach (string r in curr_champion.Race)
            {
                if (!(prev_champion.Race.Contains(r)))
                {
                    PushChangeInfo(string.Format("Race added: {0}", r));
                }
            }
            foreach (int a in prev_champion.Abilities)
            {
                if (!(curr_champion.Abilities.Contains(a)))
                {
                    PushChangeInfo(string.Format("Ability removed: {0}", diff_calculator.PreviousDatabase.Abilities[a].ToString()));
                }
            }
            foreach (int a in curr_champion.Abilities)
            {
                if (!(prev_champion.Abilities.Contains(a)))
                {
                    PushChangeInfo(string.Format("Ability added: {0}", diff_calculator.CurrentDatabase_ref.Abilities[a].ToString()));
                }
            }

            bool upgrade1_changed = false;

            foreach (int a in prev_champion.Upgrade1)
            {
                if (!(curr_champion.Upgrade1.Contains(a)))
                {
                    upgrade1_changed = true;
                    break;
                }
            }
            foreach (int a in curr_champion.Upgrade1)
            {
                if (!(prev_champion.Upgrade1.Contains(a)))
                {
                    upgrade1_changed = true;
                    break;
                }
            }
            if (upgrade1_changed)
            {
                StringBuilder sb          = new StringBuilder("Upgrade 1 changed\r\nOld:\r\n");
                List <int>    upg1_sorted = new List <int>(prev_champion.Upgrade1); upg1_sorted.Sort();
                foreach (int a in upg1_sorted)
                {
                    sb.Append(string.Format("{0}{1}\r\n", diff_calculator.PreviousDatabase.Abilities[a].ToString(), prev_champion.IsUpgrade1Default(a) ? " (default)" : ""));
                }
                sb.Append("New:\r\n");
                upg1_sorted = new List <int>(curr_champion.Upgrade1); upg1_sorted.Sort();
                foreach (int a in upg1_sorted)
                {
                    sb.Append(string.Format("{0}{1}\r\n", diff_calculator.CurrentDatabase_ref.Abilities[a].ToString(), curr_champion.IsUpgrade1Default(a) ? " (default)" : ""));
                }

                PushChangeInfo(sb.ToString());
            }
            else
            {
                if (prev_champion.Upgrade1[prev_champion.DefaultUpgrade1Index] != curr_champion.Upgrade1[curr_champion.DefaultUpgrade1Index])
                {
                    PushChangeInfo(string.Format("Default upgrade 1 changed from {0} to {1}",
                                                 diff_calculator.PreviousDatabase.Abilities[prev_champion.Upgrade1[prev_champion.DefaultUpgrade1Index]].ToString(),
                                                 diff_calculator.CurrentDatabase_ref.Abilities[curr_champion.Upgrade1[curr_champion.DefaultUpgrade1Index]].ToString()));
                }
            }

            bool upgrade2_changed = false;

            foreach (int a in prev_champion.Upgrade2)
            {
                if (!(curr_champion.Upgrade2.Contains(a)))
                {
                    upgrade2_changed = true;
                    break;
                }
            }
            foreach (int a in curr_champion.Upgrade2)
            {
                if (!(prev_champion.Upgrade2.Contains(a)))
                {
                    upgrade2_changed = true;
                    break;
                }
            }
            if (upgrade2_changed)
            {
                StringBuilder sb          = new StringBuilder("Upgrade 2 changed\r\nOld:\r\n");
                List <int>    upg2_sorted = new List <int>(prev_champion.Upgrade2); upg2_sorted.Sort();
                foreach (int a in upg2_sorted)
                {
                    sb.Append(string.Format("{0}{1}\r\n", diff_calculator.PreviousDatabase.Abilities[a].ToString(), prev_champion.IsUpgrade2Default(a) ? " (default)" : ""));
                }
                sb.Append("New:\r\n");
                upg2_sorted = new List <int>(curr_champion.Upgrade2); upg2_sorted.Sort();
                foreach (int a in upg2_sorted)
                {
                    sb.Append(string.Format("{0}{1}\r\n", diff_calculator.CurrentDatabase_ref.Abilities[a].ToString(), curr_champion.IsUpgrade2Default(a) ? " (default)" : ""));
                }

                PushChangeInfo(sb.ToString());
            }
            else
            {
                if (prev_champion.Upgrade2[prev_champion.DefaultUpgrade2Index] != curr_champion.Upgrade2[curr_champion.DefaultUpgrade2Index])
                {
                    PushChangeInfo(string.Format("Default upgrade 2 changed from {0} to {1}",
                                                 diff_calculator.PreviousDatabase.Abilities[prev_champion.Upgrade2[prev_champion.DefaultUpgrade2Index]].ToString(),
                                                 diff_calculator.CurrentDatabase_ref.Abilities[curr_champion.Upgrade2[curr_champion.DefaultUpgrade2Index]].ToString()));
                }
            }

            // special: calculate new prognosed nora cost difference
            if (prev_champion.PrognosedBaseNoraCostDifference != curr_champion.PrognosedBaseNoraCostDifference)
            {
                PushChangeInfo(string.Format("Prognosed nora cost difference changed from {0} to {1}",
                                             prev_champion.PrognosedBaseNoraCostDifference, curr_champion.PrognosedBaseNoraCostDifference));
            }
        }