private void ShowDataElementDescription(Pox.Diff.DifferenceLink link, Pox.Diff.DifferenceLink.ItemType it)
        {
            RuneDescription.TracerClear();

            if (link == null)
            {
                return;
            }

            Pox.DataElement elem = null;

            if (it == Pox.Diff.DifferenceLink.ItemType.PREVIOUS)
            {
                if (link.PreviousElement == null)
                {
                    return;
                }

                RuneDescription.database_ref = diff_calculator.PreviousDatabase;
                elem = link.PreviousElement;
            }
            else
            {
                if (link.CurrentElement == null)
                {
                    return;
                }

                RuneDescription.database_ref = diff_calculator.CurrentDatabase_ref;
                elem = link.CurrentElement;
            }

            switch (link.ElemType)
            {
            case Pox.DataElement.ElementType.CHAMPION:
                RuneDescription.SetChampionRune(RuneDescription.database_ref.Champions[elem.ID]);
                break;

            case Pox.DataElement.ElementType.ABILITY:
                RuneDescription.SetAbility(RuneDescription.database_ref.Abilities[elem.ID]);
                break;

            case Pox.DataElement.ElementType.SPELL:
                RuneDescription.SetSpellRune(RuneDescription.database_ref.Spells[elem.ID]);
                break;

            case Pox.DataElement.ElementType.RELIC:
                RuneDescription.SetRelicRune(RuneDescription.database_ref.Relics[elem.ID]);
                break;

            case Pox.DataElement.ElementType.EQUIPMENT:
                RuneDescription.SetEquipmentRune(RuneDescription.database_ref.Equipments[elem.ID]);
                break;

            default:
                RuneDescription.ClearDescription();
                break;
            }
        }
        private void PopulateChampionChangeBrowser(TreeNode tn)
        {
            foreach (var diff_elem in diff_calculator.DifferingChampions)
            {
                bool passes_filter = false;

                Pox.Diff.DifferenceLink diff_link = new Pox.Diff.DifferenceLink()
                {
                    ElemType = Pox.DataElement.ElementType.CHAMPION
                };
                if (diff_calculator.PreviousDatabase.Champions.ContainsKey(diff_elem.id))
                {
                    if (ElementPassesFilter(diff_calculator.PreviousDatabase.Champions[diff_elem.id]))
                    {
                        passes_filter = true;
                    }

                    diff_link.PreviousElement = diff_calculator.PreviousDatabase.Champions[diff_elem.id];
                }
                if (diff_calculator.CurrentDatabase_ref.Champions.ContainsKey(diff_elem.id))
                {
                    if ((!passes_filter) && (ElementPassesFilter(diff_calculator.CurrentDatabase_ref.Champions[diff_elem.id])))
                    {
                        passes_filter = true;
                    }

                    diff_link.CurrentElement = diff_calculator.CurrentDatabase_ref.Champions[diff_elem.id];
                }

                if (!passes_filter)
                {
                    continue;
                }

                tn.Nodes.Add(new TreeNode()
                {
                    Text = diff_link.ToString(), Tag = diff_link
                });
            }
            tn.Text = string.Format("Champions ({0} changes)", tn.Nodes.Count);
        }
        private void LoadChangeInfo(Pox.Diff.DifferenceLink diff_link)
        {
            ButtonPrevious.Show();
            ButtonCurrent.Show();

            Pox.DataElement prev = diff_link.PreviousElement;
            Pox.DataElement curr = diff_link.CurrentElement;

            if (prev == null)
            {
                if (curr == null)
                {
                    PanelChangeList.Controls.Add(new Label()
                    {
                        Text = "<!!!INVALID!!!>"
                    });
                    ButtonCurrent.Hide();
                }
                else
                {
                    PanelChangeList.Controls.Add(new Label()
                    {
                        Text = "Added"
                    });
                }

                ButtonPrevious.Hide();
                return;
            }
            else if (curr == null)
            {
                PanelChangeList.Controls.Add(new Label()
                {
                    Text = "Removed"
                });
                ButtonCurrent.Hide();
                return;
            }

            // load data element change info
            switch (diff_link.ElemType)
            {
            case Pox.DataElement.ElementType.CHAMPION:
                LoadChampionChangeInfo((Pox.Champion)prev, (Pox.Champion)curr);
                break;

            case Pox.DataElement.ElementType.ABILITY:
                LoadAbilityChangeInfo((Pox.Ability)prev, (Pox.Ability)curr);
                break;

            case Pox.DataElement.ElementType.SPELL:
                LoadSpellChangeInfo((Pox.Spell)prev, (Pox.Spell)curr);
                break;

            case Pox.DataElement.ElementType.EQUIPMENT:
                LoadEquipmentChangeInfo((Pox.Equipment)prev, (Pox.Equipment)curr);
                break;

            case Pox.DataElement.ElementType.RELIC:
                LoadRelicChangeInfo((Pox.Relic)prev, (Pox.Relic)curr);
                break;

            default:
                break;
            }
        }
        private void PopulateFactionChangeBrowser(TreeNode tn)
        {
            // champions
            foreach (var diff_elem in diff_calculator.DifferingChampions)
            {
                bool contains_faction = false;
                bool passes_filter    = false;

                Pox.Diff.DifferenceLink diff_link = new Pox.Diff.DifferenceLink()
                {
                    ElemType = Pox.DataElement.ElementType.CHAMPION
                };

                if (diff_calculator.PreviousDatabase.Champions.ContainsKey(diff_elem.id))
                {
                    if (ElementPassesFilter(diff_calculator.PreviousDatabase.Champions[diff_elem.id]))
                    {
                        passes_filter = true;
                    }

                    if (diff_calculator.PreviousDatabase.Champions[diff_elem.id].Faction.Contains(tn.Name))
                    {
                        diff_link.PreviousElement = diff_calculator.PreviousDatabase.Champions[diff_elem.id];
                        contains_faction          = true;
                    }
                }
                if (diff_calculator.CurrentDatabase_ref.Champions.ContainsKey(diff_elem.id))
                {
                    if ((!passes_filter) && (ElementPassesFilter(diff_calculator.CurrentDatabase_ref.Champions[diff_elem.id])))
                    {
                        passes_filter = true;
                    }

                    if (diff_calculator.CurrentDatabase_ref.Champions[diff_elem.id].Faction.Contains(tn.Name))
                    {
                        diff_link.CurrentElement = diff_calculator.CurrentDatabase_ref.Champions[diff_elem.id];
                        contains_faction         = true;
                    }
                }

                if (!contains_faction)
                {
                    continue;
                }

                if (!passes_filter)
                {
                    continue;
                }

                tn.Nodes.Add(new TreeNode()
                {
                    Text = diff_link.ToString(), Tag = diff_link
                });
            }

            // spells
            foreach (var diff_elem in diff_calculator.DifferingSpells)
            {
                bool contains_faction = false;
                bool passes_filter    = false;

                Pox.Diff.DifferenceLink diff_link = new Pox.Diff.DifferenceLink()
                {
                    ElemType = Pox.DataElement.ElementType.SPELL
                };

                if (diff_calculator.PreviousDatabase.Spells.ContainsKey(diff_elem.id))
                {
                    if (ElementPassesFilter(diff_calculator.PreviousDatabase.Spells[diff_elem.id]))
                    {
                        passes_filter = true;
                    }

                    if (diff_calculator.PreviousDatabase.Spells[diff_elem.id].Faction.Contains(tn.Name))
                    {
                        diff_link.PreviousElement = diff_calculator.PreviousDatabase.Spells[diff_elem.id];
                        contains_faction          = true;
                    }
                }
                if (diff_calculator.CurrentDatabase_ref.Spells.ContainsKey(diff_elem.id))
                {
                    if ((!passes_filter) && (ElementPassesFilter(diff_calculator.CurrentDatabase_ref.Spells[diff_elem.id])))
                    {
                        passes_filter = true;
                    }

                    if (diff_calculator.CurrentDatabase_ref.Spells[diff_elem.id].Faction.Contains(tn.Name))
                    {
                        diff_link.CurrentElement = diff_calculator.CurrentDatabase_ref.Spells[diff_elem.id];
                        contains_faction         = true;
                    }
                }

                if (!contains_faction)
                {
                    continue;
                }

                if (!passes_filter)
                {
                    continue;
                }

                tn.Nodes.Add(new TreeNode()
                {
                    Text = diff_link.ToString(), Tag = diff_link
                });
            }

            // relics
            foreach (var diff_elem in diff_calculator.DifferingRelics)
            {
                bool contains_faction = false;
                bool passes_filter    = false;

                Pox.Diff.DifferenceLink diff_link = new Pox.Diff.DifferenceLink()
                {
                    ElemType = Pox.DataElement.ElementType.RELIC
                };

                if (diff_calculator.PreviousDatabase.Relics.ContainsKey(diff_elem.id))
                {
                    if (ElementPassesFilter(diff_calculator.PreviousDatabase.Relics[diff_elem.id]))
                    {
                        passes_filter = true;
                    }

                    if (diff_calculator.PreviousDatabase.Relics[diff_elem.id].Faction.Contains(tn.Name))
                    {
                        diff_link.PreviousElement = diff_calculator.PreviousDatabase.Relics[diff_elem.id];
                        contains_faction          = true;
                    }
                }
                if (diff_calculator.CurrentDatabase_ref.Relics.ContainsKey(diff_elem.id))
                {
                    if ((!passes_filter) && (ElementPassesFilter(diff_calculator.CurrentDatabase_ref.Relics[diff_elem.id])))
                    {
                        passes_filter = true;
                    }

                    if (diff_calculator.CurrentDatabase_ref.Relics[diff_elem.id].Faction.Contains(tn.Name))
                    {
                        diff_link.CurrentElement = diff_calculator.CurrentDatabase_ref.Relics[diff_elem.id];
                        contains_faction         = true;
                    }
                }

                if (!contains_faction)
                {
                    continue;
                }

                if (!passes_filter)
                {
                    continue;
                }

                tn.Nodes.Add(new TreeNode()
                {
                    Text = diff_link.ToString(), Tag = diff_link
                });
            }

            // equipments
            foreach (var diff_elem in diff_calculator.DifferingEquipments)
            {
                bool contains_faction = false;
                bool passes_filter    = false;

                Pox.Diff.DifferenceLink diff_link = new Pox.Diff.DifferenceLink()
                {
                    ElemType = Pox.DataElement.ElementType.EQUIPMENT
                };

                if (diff_calculator.PreviousDatabase.Equipments.ContainsKey(diff_elem.id))
                {
                    if (ElementPassesFilter(diff_calculator.PreviousDatabase.Equipments[diff_elem.id]))
                    {
                        passes_filter = true;
                    }

                    if (diff_calculator.PreviousDatabase.Equipments[diff_elem.id].Faction.Contains(tn.Name))
                    {
                        diff_link.PreviousElement = diff_calculator.PreviousDatabase.Equipments[diff_elem.id];
                        contains_faction          = true;
                    }
                }
                if (diff_calculator.CurrentDatabase_ref.Equipments.ContainsKey(diff_elem.id))
                {
                    if ((!passes_filter) && (ElementPassesFilter(diff_calculator.CurrentDatabase_ref.Equipments[diff_elem.id])))
                    {
                        passes_filter = true;
                    }

                    if (diff_calculator.CurrentDatabase_ref.Equipments[diff_elem.id].Faction.Contains(tn.Name))
                    {
                        diff_link.CurrentElement = diff_calculator.CurrentDatabase_ref.Equipments[diff_elem.id];
                        contains_faction         = true;
                    }
                }

                if (!contains_faction)
                {
                    continue;
                }

                if (!passes_filter)
                {
                    continue;
                }

                tn.Nodes.Add(new TreeNode()
                {
                    Text = diff_link.ToString(), Tag = diff_link
                });
            }

            tn.Text = string.Format("{0} ({1} changes)", tn.Name, tn.Nodes.Count);
        }