public InterpretedMotionState(MovementData data) { MovementData = data; CurrentStyle = data.CurrentStyle; Flags = BuildMovementFlags(); }
public MovementInvalid(MovementData movementData, Motion motion) { MovementData = movementData; State = new InterpretedMotionState(movementData, motion); if ((motion.MotionFlags & MotionFlags.StickToObject) != 0) { StickyObject = motion.TargetGuid; } }
public static void Write(this BinaryWriter writer, MovementData motion, bool header = true) { var wo = motion.WorldObject; var sequence = wo.Sequences; if (header) { writer.Write(sequence.GetNextSequence(SequenceType.ObjectMovement)); if (motion.IsAutonomous) { writer.Write(sequence.GetCurrentSequence(SequenceType.ObjectServerControl)); } else { writer.Write(sequence.GetNextSequence(SequenceType.ObjectServerControl)); } writer.Write(Convert.ToByte(motion.IsAutonomous)); writer.Align(); } writer.Write((byte)motion.MovementType); writer.Write((byte)motion.MotionFlags); writer.Write((ushort)motion.CurrentStyle); // send MotionStance as ushort switch (motion.MovementType) { case MovementType.Invalid: writer.Write(motion.Invalid); break; case MovementType.MoveToObject: writer.Write(motion.MoveToObject); break; case MovementType.MoveToPosition: writer.Write(motion.MoveToPosition); break; case MovementType.TurnToObject: writer.Write(motion.TurnToObject); break; case MovementType.TurnToHeading: writer.Write(motion.TurnToHeading); break; } }
public InterpretedMotionState(MovementData data, Motion motion) { MovementData = data; CurrentStyle = data.CurrentStyle; var state = motion.MotionState; ForwardCommand = state.ForwardCommand; SidestepCommand = state.SidestepCommand; TurnCommand = state.TurnCommand; ForwardSpeed = state.ForwardSpeed; SidestepSpeed = state.SidestepSpeed; TurnSpeed = state.TurnSpeed; Commands = state.Commands; Flags = BuildMovementFlags(); }
public InterpretedMotionState(InterpretedMotionState state) { // copy constructor Flags = state.Flags; MovementData = state.MovementData; CurrentStyle = state.CurrentStyle; ForwardCommand = state.ForwardCommand; SidestepCommand = state.SidestepCommand; TurnCommand = state.TurnCommand; ForwardSpeed = state.ForwardSpeed; SidestepSpeed = state.SidestepSpeed; TurnSpeed = state.TurnSpeed; if (state.Commands != null) { Commands = new List <MotionItem>(); foreach (var command in state.Commands) { Commands.Add(new MotionItem(command)); } } }
public MovementInvalid(MovementData movementData, InterpretedMotionState state) { MovementData = movementData; State = state; state.BuildMovementFlags(); }
public ObjectGuid StickyObject; // choose valid sections by masking against MotionFlags: 0x1 - object to stick to public MovementInvalid(MovementData movementData) { MovementData = movementData; State = new InterpretedMotionState(movementData); }