WinterSync.ArchiveLister.ArchiveLister C# (CSharp) Méthode

ArchiveLister() public méthode

public ArchiveLister ( string springPath ) : System.Collections.Generic
springPath string
Résultat System.Collections.Generic
        public ArchiveLister(string springPath)
        {
            Mods = new Dictionary<string, string>();
            Maps = new Dictionary<string, string>();
            var contentFolders = new[] {"mods", "maps", "base"};
            var L = SpringLua.GetLuaState(springPath);

            foreach (var folderPath in contentFolders) {
                foreach (var archivePath in Directory.GetFiles(Path.Combine(springPath, folderPath), "*")) {
                    if (!IsSpringArchive(archivePath)) continue;
                    foreach (var fileName in Archive.RawListFiles(archivePath)) {
                        if (IsModInfo(fileName)) {
                            var modName = SpringLua.ProtectedGetModName(L, archivePath);
                            if (modName != null) {
                                Mods.Remove(modName);
                                Mods[modName] = archivePath;
                            }
                        } else if (IsMap(fileName)) {
                            var mapName = Path.GetFileName(fileName);
                            Maps.Remove(mapName);
                            Maps[mapName] = archivePath;
                        }
                    }
                }
            }
            Lua.lua_close(L);
        }