public abstract IEntity CreateEntity(IObjectGUID objectGUID, EntityTypeID typeID, bool isSelf);
private static IEntity HandleMovementUpdate(ParsingContext context, Packet packet, IObjectGUID guid, EntityTypeID entityTypeID, ushort map) { var playHoverAnim = packet.ReadBit(); var suppressedGreetings = packet.ReadBit(); var hasRotation = packet.ReadBit(); var hasAnimKits = packet.ReadBit(); var hasTargetGUID = packet.ReadBit(); var entity = context.ObjectManager[guid, entityTypeID, packet.ReadBit()]; var movementSnapshot = entity.MovementInfo[packet.Moment]; movementSnapshot.PlayHoverAnim = playHoverAnim; movementSnapshot.SuppressedGreetings = suppressedGreetings; var hasVehicleData = packet.ReadBit(); var hasLivingData = packet.ReadBit(); var stopFrameCount = packet.ReadBits(24); movementSnapshot.NoBirthAnim = packet.ReadBit(); var hasGoTransportPosition = packet.ReadBit(); var hasStationaryPosition = packet.ReadBit(); var hasAreaTrigger = packet.ReadBit(); movementSnapshot.EnablePortals = packet.ReadBit(); var hasTransport = packet.ReadBit(); // Readers var livingReader = new LivingReader(); var goTransportReader = new GoTransportReader(); var animKitReader = new AnimKitsReader(); if (hasLivingData) { livingReader.FirstPass(movementSnapshot, packet, context); } if (hasGoTransportPosition) { goTransportReader.FirstPass(movementSnapshot, packet, context); } if (hasTargetGUID) // 446 { movementSnapshot.TargetGUID = context.Helper.GuidResolver.CreateGUID(); movementSnapshot.TargetGUID !.AsBitStream().Initialize(packet, 2, 7, 0, 4, 5, 6, 1, 3); } if (hasAnimKits) { animKitReader.FirstPass(movementSnapshot, packet, context); } packet.ResetBitReader(); // Exit out early if stop frames received for a non-transport if (stopFrameCount != 0 && movementSnapshot.Transport == null) { throw new InvalidOperationException(); } // Shove them in trnasport even though they aren't in the data block itself. if (movementSnapshot.Transport == null) { for (var i = 0; i < stopFrameCount; ++i) { packet.ReadUInt32(); } } else { movementSnapshot.Transport !.StopFrames = new uint[stopFrameCount]; for (var i = 0; i < stopFrameCount; ++i) { movementSnapshot.Transport !.StopFrames[i] = packet.ReadUInt32(); } } if (hasLivingData) { livingReader.SecondPass(movementSnapshot, packet, context); } if (hasVehicleData) { movementSnapshot.Vehicle = new MovementInfo.VehicleData(); movementSnapshot.Vehicle.Orientation = packet.ReadSingle(); movementSnapshot.Vehicle.ID = packet.ReadUInt32(); } if (hasGoTransportPosition) { goTransportReader.SecondPass(movementSnapshot, packet, context); } if (hasRotation) { // Packed Quaternion // TODO var packedRotation = packet.ReadUInt64(); } if (hasAreaTrigger) { packet.ReadSingle(); packet.ReadSingle(); packet.ReadSingle(); packet.ReadSingle(); packet.ReadUInt8(); packet.ReadSingle(); packet.ReadSingle(); packet.ReadSingle(); packet.ReadSingle(); packet.ReadSingle(); packet.ReadSingle(); packet.ReadSingle(); packet.ReadSingle(); packet.ReadSingle(); packet.ReadSingle(); packet.ReadSingle(); packet.ReadSingle(); } if (hasStationaryPosition) { movementSnapshot.Stationary = new Vector4() { O = packet.ReadSingle(), X = packet.ReadSingle(), Y = packet.ReadSingle(), Z = packet.ReadSingle() }; } if (hasTargetGUID) { movementSnapshot.TargetGUID !.AsBitStream().Parse(packet, 4, 0, 3, 5, 7, 6, 2, 1); } if (hasAnimKits) { animKitReader.SecondPass(movementSnapshot, packet, context); } if (hasTransport) { movementSnapshot.PathProgress = packet.ReadUInt32(); } return(entity); }