public Mod Clone()
 {
     var tmpMod = new Mod(Name);
     foreach (var p in Parts)
     {
         tmpMod.Parts.Add(p.Key, p.Value);
     }
     foreach (var pre in Prefixes)
     {
         tmpMod.Prefixes.Add(pre);
     }
     return tmpMod;
 }
 public void AddMod(string name, Dictionary<string, string> parts, List<string> prefixes)
 {
     var mod = new Mod(name, parts, prefixes);
     Mods.Add(mod);
 }
        private void DeletePartsByMod(Mod mod)
        {
            //TODO: Optimise!
            var nodesToEdit = new List<Node>();
            foreach (var modpart in mod.Parts)
            {
                foreach (var node in _tree.Nodes)
                {
                    foreach (var part in node.Parts)
                    {
                        if ((string)part.Value == modpart.Key)
                        {
                            nodesToEdit.Add(node);
                            break;
                        }
                    }
                }
            }
            foreach (var modprefix in mod.Prefixes)
            {
                foreach (var node in _tree.Nodes)
                {
                    foreach (var part in node.Parts)
                    {
                        if (part.Value.ToString().StartsWith(modprefix.TrimEnd('*')))
                        {
                            if(!mod.Parts.ContainsKey(part))
                                mod.Parts.Add(part,"");
                            if (!nodesToEdit.Contains(node))
                                nodesToEdit.Add(node);
                            break;
                        }
                    }
                }
            }

            foreach (var node in nodesToEdit)
            {
                node.Parts.RemoveAll(p => mod.Parts.Any(p2 => (string)p.Value == p2.Key));
                node.Parts.RemoveAll(p => mod.Prefixes.Any(p2 => p.Value.ToString().StartsWith(p2.TrimEnd('*'))));
            }
        }