Esempio n. 1
0
 /// <summary>
 ///     Adds a Packer Format to the system
 /// </summary>
 /// <param name="formatProvider">The format to be added.</param>
 public static void AddPackerFormat(APluginPackerFormat formatProvider)
 {
     if (PackerMap.All(x => x.GetType() != formatProvider.GetType()))
     {
         PluginManager.SendLog($"Adding Plugin Packer Format: {formatProvider.GetType().Name}");
         PackerMap.Add(formatProvider);
     }
 }
Esempio n. 2
0
 /// <summary>
 ///     Removes a Packer Format from the system
 /// </summary>
 /// <param name="formatProvider">The format to be removed.</param>
 public static void RemovePackerFormat(APluginPackerFormat formatProvider)
 {
     if (PackerMap.Contains(formatProvider))
     {
         PluginManager.SendLog($"Removing Plugin Packer Format: {formatProvider.GetType().Name}");
         PackerMap.Remove(formatProvider);
     }
 }
Esempio n. 3
0
        /// <summary>
        ///     Unpacks a File into an Output Directory
        /// </summary>
        /// <param name="file">File to Unpack</param>
        /// <param name="outputDirectory">Output Directory</param>
        public static void Unpack(string file, string outputDirectory)
        {
            PluginManager.SendLog("Loading Data from File: " + Path.GetFileName(file));
            APluginPackerFormat format = PackerMap.FirstOrDefault(x => x.CanLoad(file));

            PluginManager.SendLog($"Selected Format: {format.GetType().Name}");
            PluginManager.SendLog($"Output Directory: {Path.GetFileName(outputDirectory)}");
            format?.Unpack(file, outputDirectory);
        }