Asgard.Core.Network.Bootstrap.InitPacketTypes C# (CSharp) Method

InitPacketTypes() private static method

private static InitPacketTypes ( ) : void
return void
        private static void InitPacketTypes()
        {
            var action = new Action<TypeInfo>((type) =>
            {
                var packetAttribute = type.GetCustomAttribute<PacketAttribute>();
                if (packetAttribute != null)
                {
                    packetAttribute.BindToFactory(type);
                }
            });

            var check = new Func<TypeInfo, bool>((type) =>
             {
                 if (type.GetCustomAttribute<PacketAttribute>() != null)
                     return true;
                 else
                     return false;
             });

            AssemblyScanner.Execute<PacketAttribute>(action, check);
        }