Example #1
0
        /// <summary>
        /// Checks if the mod collisions with any other installed mod.
        /// </summary>
        public bool ModCollision(Mod m)
        {
            string mPath = Mod.InstallPath + m.Slug;

            try {
                var files     = Directory.GetFiles(mPath).Select(x => Path.GetFileName(x));
                var collision = InstalledMods.SelectMany(x => Directory.GetFiles(Mod.InstallPath + x.Slug).Select(y => Path.GetFileName(y))).Intersect(files);
                if (collision.Count() != 0)
                {
                    return(true);
                }
            } catch {
                return(true);
            }
            return(false);
        }