private static void InitializeStreams(params Type[] types)
 {
     foreach (var item in types)
     {
         DirectoryGenerator._streams.Add(item, new FileStream(DirectoryGenerator.GetFileName(item.Name), FileMode.Create, FileAccess.Write));
     }
 }
        public static void Initialize()
        {
            DirectoryGenerator.InitializeStreams(typeof(AllianceListMessage), typeof(AllianceVersatileInfoListMessage),
                                                 typeof(GuildListMessage), typeof(GuildVersatileInfoListMessage));

            DirectoryGenerator.Generate();
        }
        private static void Generate()
        {
            lock (DirectoryGenerator._lock)
            {
                DirectoryGenerator.Generate <AllianceListMessage>(DirectoryGenerator.GenerateAllianceList);
                DirectoryGenerator.Generate <AllianceVersatileInfoListMessage>(DirectoryGenerator.GenerateAllianceVersatileList);

                DirectoryGenerator.Generate <GuildListMessage>(DirectoryGenerator.GenerateGuildList);
                DirectoryGenerator.Generate <GuildVersatileInfoListMessage>(DirectoryGenerator.GenerateGuildVersatileList);
            }

            Task.Factory.StartNewDelayed(DirectoryGenerator.NextDirectoryActualization, DirectoryGenerator.Generate);
        }