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


C# StreamHandler.WriteStruct方法代码示例

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


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

示例1: Write

        public void Write(StreamHandler Writer)
        {
            Writer.WriteUInt32((uint)Flags);

            if ((Flags & (
                SpellCastTargetFlags.Unit | SpellCastTargetFlags.Unk2 |
                SpellCastTargetFlags.Object |
                SpellCastTargetFlags.Corpse | SpellCastTargetFlags.PvPCorpse
                )) != 0)
                Writer.WritePackedGuid(TargetUnit);

            if ((Flags & (SpellCastTargetFlags.Item | SpellCastTargetFlags.TradeItem)) != 0)
                Writer.WritePackedGuid(TargetItem);

            if ((Flags & SpellCastTargetFlags.SourceLocation) != 0)
            {
                Writer.WritePackedGuid(SourceTransportGuid);
                Writer.WriteStruct<Vector3>(SourceLocation);
            }

            if ((Flags & SpellCastTargetFlags.DestLocation) != 0)
            {
                Writer.WritePackedGuid(DestTransportGuid);
                Writer.WriteStruct<Vector3>(DestLocation);
            }

            if ((Flags & SpellCastTargetFlags.String) != 0)
                Writer.WriteCString(StringTarget);
        }
开发者ID:SkyFire,项目名称:Kamilla.Wow,代码行数:29,代码来源:SpellCasting.cs

示例2: Save

        public override void Save(StreamHandler writer)
        {
            writer.WriteInt32(Items.Length);

            foreach (var item in Items)
                writer.WriteStruct(item);

            writer.WriteUInt32(TotalItemCount);
            writer.WriteUInt32(NextSearchDelayMs);
        }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:10,代码来源:AuctionListResult.cs

示例3: Save

        /// <summary>
        /// Saves the current instance of SpellGo class to a StreamHandler.
        /// </summary>
        /// <param name="Writer">The StreamHandler to use.</param>
        public override void Save(StreamHandler Writer)
        {
            Writer.WritePackedGuid(Caster);
            Writer.WritePackedGuid(CastInvoker);
            Writer.WriteByte(CastId);
            Writer.WriteUInt32(SpellId);
            Writer.WriteUInt32((uint)Flags);
            Writer.WriteUInt32(Unk43);
            Writer.WriteUInt32(CastTime);

            Writer.WriteByte((byte)Hits.Count);
            foreach (WowGuid guid in Hits)
                Writer.WriteGuid(guid);

            Writer.WriteByte((byte)Misses.Count);
            foreach (MissData miss in Misses)
                miss.Write(Writer);

            TargetData.Write(Writer);

            if ((Flags & CastFlags.PredictedPower) != 0)
                Writer.WriteUInt32(PredictedPower);

            if ((Flags & CastFlags.RuneStates) != 0)
            {
                Writer.WriteByte((byte)RunesBefore);
                Writer.WriteByte((byte)RunesAfter);
                for (int i = 0; i < RuneCooldowns.Length; ++i)
                    Writer.WriteByte((byte)RuneCooldowns[i]);
            }

            if ((Flags & CastFlags.Unk0x00020000) != 0)
            {
                Writer.WriteSingle(Unk0x20000_Float);
                Writer.WriteUInt32(Unk0x20000_UInt32);
            }

            if ((Flags & CastFlags.Ammo) != 0)
            {
                Writer.WriteUInt32(ProjectileDisplayId);
                Writer.WriteUInt32((uint)ProjectileInventoryType);
            }

            if ((Flags & CastFlags.Unk0x00080000) != 0)
            {
                Writer.WriteUInt32(Unk0x80000_UInt32_1);
                Writer.WriteUInt32(Unk0x80000_UInt32_2);
            }

            if ((TargetData.Flags & SpellCastTargetFlags.DestLocation) != 0)
            {
                Writer.WriteByte(DestLocationCounter);
            }

            if ((TargetData.Flags & SpellCastTargetFlags.Unk4) != 0)
            {
                Writer.WriteUInt32(Unk4_Count);
                foreach (var pair in Unk4_List)
                {
                    Writer.WriteStruct(pair.Value);
                    Writer.WriteGuid(pair.Key);
                    if (pair.Key.IsEmpty)
                        break;
                }
            }
        }
开发者ID:SkyFire,项目名称:Kamilla.Wow,代码行数:70,代码来源:SpellCasting.cs


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