IPackage GetSubPacket(Stream stream)
{
IPackage retVal = null;
object[] parms = { stream, 0 };
Type[] constructorSignature = { typeof(Stream), typeof(int) };
Type t = Type.GetType(typeof(ShipActionSubPackets.ShipActionSubPacketType).Namespace + "." + this.SubPacketType.ToString());
if (t != null)
{
ConstructorInfo constructor = t.GetConstructor(constructorSignature);
object obj = constructor.Invoke(parms);
retVal = obj as IPackage;
}
return retVal;
}