Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
            }
        }