コード例 #1
0
ファイル: MotionItem.cs プロジェクト: ziang4891/ACE
 public MotionItem(MotionItem motionItem)
 {
     // copy constructor
     WorldObject          = motionItem.WorldObject;
     MotionCommand        = motionItem.MotionCommand;
     PackedSequence       = motionItem.PackedSequence;
     ServerActionSequence = motionItem.ServerActionSequence;
     IsAutonomous         = motionItem.IsAutonomous;
     Speed = motionItem.Speed;
 }
コード例 #2
0
ファイル: MotionItem.cs プロジェクト: Yonneh0/ACE
        public static void Write(this BinaryWriter writer, MotionItem mc)
        {
            var sequence = mc.WorldObject.Sequences;

            writer.Write((ushort)mc.MotionCommand);      // verified

            // should already be masked with 0x7FFF
            var nextSequence = sequence.GetNextSequence(SequenceType.Motion);

            if (mc.IsAutonomous)
            {
                nextSequence[1] |= 0x80;    // if client-initiated motion, set upper bit
            }
            writer.Write(nextSequence);

            writer.Write(mc.Speed);
        }