当前位置: 首页>>代码示例>>C#>>正文


C# StreamHandler.ReadSByte方法代码示例

本文整理汇总了C#中StreamHandler.ReadSByte方法的典型用法代码示例。如果您正苦于以下问题:C# StreamHandler.ReadSByte方法的具体用法?C# StreamHandler.ReadSByte怎么用?C# StreamHandler.ReadSByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StreamHandler的用法示例。


在下文中一共展示了StreamHandler.ReadSByte方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReadElement


//.........这里部分代码省略.........
                case MovementStatusElements.TransportHaveTime2:
                    if (status.HaveTransportData)
                        status.HaveTransportTime2 = reader.UnalignedReadBit();
                    break;
                case MovementStatusElements.TransportHaveTime3:
                    if (status.HaveTransportData)
                        status.HaveTransportTime3 = reader.UnalignedReadBit();
                    break;
                case MovementStatusElements.HaveSpline:
                    status.HaveSpline = reader.UnalignedReadBit();
                    break;
                case MovementStatusElements.HaveSpline2:
                    status.HaveSpline2 = reader.UnalignedReadBit();
                    break;
                case MovementStatusElements.PositionX:
                    status.Position.X = reader.ReadSingle();
                    break;
                case MovementStatusElements.PositionY:
                    status.Position.Y = reader.ReadSingle();
                    break;
                case MovementStatusElements.PositionZ:
                    status.Position.Z = reader.ReadSingle();
                    break;
                case MovementStatusElements.PositionO:
                    status.Orientation = !reader.UnalignedReadBit() ? 1.0f : 0.0f;
                    break;
                case MovementStatusElements.PositionO_2:
                    if (status.Orientation != 0.0f)
                        status.Orientation = reader.ReadSingle();
                    break;
                case MovementStatusElements.Pitch:
                    status.HavePitch = !reader.UnalignedReadBit();
                    break;
                case MovementStatusElements.Pitch_2:
                    if (status.HavePitch)
                        status.Pitch = reader.ReadSingle();
                    break;
                case MovementStatusElements.FallTime:
                    if (status.HaveFallData)
                        status.FallTime = reader.ReadUInt32();
                    break;
                case MovementStatusElements.SplineElev:
                    status.HaveSplineElevation = !reader.UnalignedReadBit();
                    break;
                case MovementStatusElements.SplineElev_2:
                    if (status.HaveSplineElevation)
                        status.SplineElevation = reader.ReadSingle();
                    break;
                case MovementStatusElements.FallHorizontalSpeed:
                    if (status.HaveFallDirection)
                        status.FallHorizontalSpeed = reader.ReadSingle();
                    break;
                case MovementStatusElements.FallVerticalSpeed:
                    if (status.HaveFallData)
                        status.FallVerticalSpeed = reader.ReadSingle();
                    break;
                case MovementStatusElements.FallCosAngle:
                    if (status.HaveFallDirection)
                        status.FallCosAngle = reader.ReadSingle();
                    break;
                case MovementStatusElements.FallSinAngle:
                    if (status.HaveFallDirection)
                        status.FallSinAngle = reader.ReadSingle();
                    break;
                case MovementStatusElements.TransportSeat:
                    if (status.HaveTransportData)
                        status.TransportSeat = reader.ReadSByte();
                    break;
                case MovementStatusElements.TransportPositionO:
                    if (status.HaveTransportData)
                        status.TransportFacing = reader.ReadSingle();
                    break;
                case MovementStatusElements.TransportPositionX:
                    if (status.HaveTransportData)
                        status.TransportPosition.X = reader.ReadSingle();
                    break;
                case MovementStatusElements.TransportPositionY:
                    if (status.HaveTransportData)
                        status.TransportPosition.Y = reader.ReadSingle();
                    break;
                case MovementStatusElements.TransportPositionZ:
                    if (status.HaveTransportData)
                        status.TransportPosition.Z = reader.ReadSingle();
                    break;
                case MovementStatusElements.TransportTime:
                    if (status.HaveTransportData)
                        status.TransportTime = reader.ReadUInt32();
                    break;
                case MovementStatusElements.TransportTime2:
                    if (status.HaveTransportTime2)
                        status.TransportTime2 = reader.ReadUInt32();
                    break;
                case MovementStatusElements.TransportTime3:
                    if (status.HaveTransportTime3)
                        status.TransportTime3 = reader.ReadUInt32();
                    break;
                default:
                    throw new InvalidOperationException("Unknown element: " + element);
            }
        }
开发者ID:SkyFire,项目名称:Kamilla.Wow,代码行数:101,代码来源:RegularMovementPacket.cs

示例2: MovementInfo


//.........这里部分代码省略.........
            }

            if (this.HaveVehicleData)
            {
                Reader
                    .ReadUInt32(out this.VehicleId)
                    .ReadSingle(out this.VehicleAimAdjustement);
            }

            if (this.HaveGameObjectPosition)
            {
                fixed (byte* bytes = this.TransportGuid.Bytes)
                {
                    Reader
                        .ReadXorByte(ref bytes[1])
                        .ReadXorByte(ref bytes[4])
                        .ReadSingle(out this.TransportPosition.Z);

                    if (this.HaveTransportTime3)
                        this.TransportTime3 = Reader.ReadUInt32();

                    this.TransportTime = Reader.ReadUInt32();

                    Reader
                        .ReadXorByte(ref bytes[5])
                        .ReadXorByte(ref bytes[6])
                        .ReadSingle(out this.TransportPosition.X)
                        .ReadXorByte(ref bytes[2]);

                    if (this.HaveTransportTime2)
                        this.TransportTime2 = Reader.ReadUInt32();

                    Reader
                        .ReadSByte(out this.TransportSeat)
                        .ReadXorByte(ref bytes[3])
                        .ReadSingle(out this.TransportPosition.Y)
                        .ReadSingle(out this.TransportFacing)
                        .ReadXorByte(ref bytes[7])
                        .ReadXorByte(ref bytes[0]);
                }
            }

            if (this.Living)
            {
                if (this.HaveSpline2)
                {
                    if (this.HaveSpline)
                    {
                        var points = this.Spline.Points;
                        points.Capacity = (int)splinePoints;
                        for (int i = 0; i < splinePoints; i++)
                            points.Add(new Vector3()
                            {
                                Y = Reader.ReadSingle(),
                                X = Reader.ReadSingle(),
                                Z = Reader.ReadSingle()
                            });

                        if (this.Spline.HaveDurationMultiplier)
                        {
                            this.Spline.DurationMultiplier = Reader.ReadSingle();
                        }

                        this.Spline.UnknownFloat2 = Reader.ReadSingle();

                        if (this.Spline.SplineType == SplineType.FacingTarget)
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:67,代码来源:MovementInfo.cs


注:本文中的StreamHandler.ReadSByte方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。