using System;
using System.Collections.Generic;
using System.Linq;
namespace Pulsar.Common.Messages
{
///
/// Legacy TypeRegistry - no longer needed with MessagePack serialization.
/// Kept for compatibility during migration.
///
public static class TypeRegistry
{
///
/// Legacy method - no longer needed with MessagePack.
///
/// The parent type
/// Type to be added
public static void AddTypeToSerializer(Type parent, Type type)
{
// No-op: MessagePack handles polymorphism through custom resolvers
}
///
/// Legacy method - no longer needed with MessagePack.
///
/// The parent type
/// Types to add
public static void AddTypesToSerializer(Type parent, params Type[] types)
{
// No-op: MessagePack handles polymorphism through custom resolvers
}
///
/// Gets all types that implement the specified interface.
/// Still used by legacy code during migration.
///
public static IEnumerable GetPacketTypes(Type type)
{
return AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(s => s.GetTypes())
.Where(p => type.IsAssignableFrom(p) && !p.IsInterface);
}
}
}