using System; using System.Collections.Generic; namespace UnityEngine.Advertisements.Editor { internal static class SkAdNetworkParser { private static Dictionary s_Parsers; static SkAdNetworkParser() { s_Parsers = new Dictionary { { SkAdNetworkFileExtension.XML, new SkAdNetworkXmlParser() }, { SkAdNetworkFileExtension.JSON, new SkAdNetworkJsonParser() }, { SkAdNetworkFileExtension.NONE, new SkAdNetworkUrlParser() } }; } public static ISkAdNetworkParser GetParser(string parserType) { try { s_Parsers.TryGetValue(parserType, out var parser); return parser; } catch (Exception) { } return null; } public static IEnumerable GetAllParsers() { return s_Parsers.Values; } } }