ManateesAgainstCards.Network.Packet.Packet C# (CSharp) Method

Packet() static private method

static private Packet ( ) : System
return System
        static Packet()
        {
            PacketTypes = new Dictionary<PacketType, Type>();

            Assembly assembly = Assembly.GetCallingAssembly();
            var types = assembly.GetExportedTypes().Where(type => type.IsSubclassOf(typeof(Packet)));

            foreach (Type type in types)
            {
                Packet instance = (Packet)Activator.CreateInstance(type);
                PacketTypes[instance.Type] = type;
            }
        }