private void RemoveSmashModItem(List <SmashModItem> list, string partition, string relativePath)
        {
            if (list == null)
            {
                list = new List <SmashModItem>();
            }

            SmashModItem resCol = list.Find(p => p.Partition == partition);

            if (resCol == null)
            {
                return;
            }
            resCol.Paths.Remove(relativePath);
        }
        private bool IsSmashModItem(List <SmashModItem> list, string partition, string relativePath)
        {
            if (list == null)
            {
                list = new List <SmashModItem>();
            }

            SmashModItem resCol = list.Find(p => p.Partition == partition);

            if (resCol == null)
            {
                return(false);
            }

            string pathFound = resCol.Paths.Find(p => (p.EndsWith("packed") && relativePath.StartsWith(p.Substring(0, p.LastIndexOf("packed"))) || p == relativePath));

            if (!string.IsNullOrEmpty(pathFound))
            {
                return(true);
            }
            return(false);
        }
        internal bool IsResourceInPackage(string partition, string relativePath)
        {
            if (ResourcesToPack == null)
            {
                ResourcesToPack = new List <SmashModItem>();
            }

            SmashModItem resCol = ResourcesToPack.Find(p => p.Partition == partition);

            if (resCol == null)
            {
                return(false);
            }

            string pathFound = resCol.Paths.Find(p => relativePath.StartsWith(p));

            if (!string.IsNullOrEmpty(pathFound))
            {
                return(true);
            }
            return(false);
        }
        private void AddSmashModItem(List <SmashModItem> list, string partition, string relativePath)
        {
            if (list == null)
            {
                list = new List <SmashModItem>();
            }

            SmashModItem resCol = list.Find(p => p.Partition == partition);

            if (resCol == null)
            {
                resCol = new SmashModItem()
                {
                    Partition = partition, Paths = new List <string>()
                };
                list.Add(resCol);
            }
            string checkPathExist = resCol.Paths.Find(p => p == relativePath);

            if (string.IsNullOrEmpty(checkPathExist))
            {
                resCol.Paths.Add(relativePath);
            }
        }