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);
}