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


C# StreamHandler.ReadPackedGuid方法代码示例

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


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

示例1: Read

        public void Read(StreamHandler Reader)
        {
            Flags = (SpellCastTargetFlags)Reader.ReadUInt32();

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

            if ((Flags & (SpellCastTargetFlags.Item | SpellCastTargetFlags.TradeItem)) != 0)
                TargetItem = Reader.ReadPackedGuid();

            if ((Flags & SpellCastTargetFlags.SourceLocation) != 0)
            {
                SourceTransportGuid = Reader.ReadPackedGuid();
                SourceLocation = Reader.ReadVector3();
            }

            if ((Flags & SpellCastTargetFlags.DestLocation) != 0)
            {
                DestTransportGuid = Reader.ReadPackedGuid();
                DestLocation = Reader.ReadVector3();
            }

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

示例2: Read

        public override void Read(StreamHandler reader)
        {
            this.Unit = reader.ReadPackedGuid();

            var count = reader.ReadInt32();
            this.ThreatList = new ThreatUpdatePair[count];
            for (int i = 0; i < count; ++i)
                this.ThreatList[i] = new ThreatUpdatePair { Unit = reader.ReadPackedGuid(), Threat = reader.ReadUInt32() };
        }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:9,代码来源:ThreatUpdate.cs

示例3: ReadObjectValuesUpdate

 private void ReadObjectValuesUpdate(StreamHandler Reader)
 {
     var guid = Reader.ReadPackedGuid();
     var values = ReadValues(Reader);
     if (!m_valuesUpdates.ContainsKey(guid))
         m_valuesUpdates.Add(guid, values);
     else
         Console.WriteLine("Error: Updated object duplicate guid {0}", guid);
 }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:9,代码来源:UpdateData.cs

示例4: Read

        public override void Read(StreamHandler reader)
        {
            Caster = reader.ReadPackedGuid();
            SpellId = reader.ReadUInt32();
            Duration = reader.ReadInt32();

            HaveFlags = reader.ReadBoolean();
            if (HaveFlags)
            {
                TargetFlags1 = reader.ReadUInt32();
                TargetFlags2 = reader.ReadUInt32();
            }

            Unk_HaveData2 = reader.ReadBoolean();
            if (Unk_HaveData2)
            {
                Unk_Guid1 = reader.ReadPackedGuid();
                Unk_UInt3 = reader.ReadUInt32();
                Unk_Byte = reader.ReadByte();
                if (Unk_Byte == 2)
                    Unk_Guid2 = reader.ReadPackedGuid();
            }
        }
开发者ID:SkyFire,项目名称:Kamilla.Wow,代码行数:23,代码来源:ChannelStart.cs

示例5: Read

        public override void Read(StreamHandler reader)
        {
            Unit = reader.ReadPackedGuid();

            while (!reader.IsRead)
            {
                var update = new Aura();
                update.Unit = Unit;

                update.Read(reader);

                this.Auras.Add(update);
            }
        }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:14,代码来源:AuraUpdates.cs

示例6: ReadObjectCreateUpdate

        private void ReadObjectCreateUpdate(StreamHandler Reader)
        {
            var guid = Reader.ReadPackedGuid();
            var type = (ObjectTypeId)Reader.ReadByte();

            WowObject obj;

            switch (type)
            {
                case ObjectTypeId.Container:
                    obj = new WowContainer();
                    break;
                case ObjectTypeId.Corpse:
                    obj = new WowCorpse();
                    break;
                case ObjectTypeId.DynamicObject:
                    obj = new WowDynamicObject();
                    break;
                case ObjectTypeId.GameObject:
                    obj = new WowGameObject();
                    break;
                case ObjectTypeId.Item:
                    obj = new WowItem();
                    break;
                case ObjectTypeId.Object:
                default:
                    throw new Exception("Cannot instantiate an object with TypeId=" + type);
                case ObjectTypeId.Player:
                    obj = new WowPlayer();
                    break;
                case ObjectTypeId.Unit:
                    obj = new WowUnit();
                    break;
                case ObjectTypeId.AreaTrigger:
                    obj = new WowAreaTrigger();
                    break;
            }

            obj.Guid = guid;
            obj.MovementData = new MovementInfo(Reader);
            obj.SetValues(ReadValues(Reader));
            obj.ResetUpdatedFields();

            if (!m_createdObjects.ContainsKey(guid))
                m_createdObjects.Add(guid, obj);
            else
                Console.WriteLine("Error: Created object duplicate guid {0}", guid);
        }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:48,代码来源:UpdateData.cs

示例7: Read

 public override void Read(StreamHandler reader)
 {
     this.Unit = reader.ReadPackedGuid();
 }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:4,代码来源:ThreatClear.cs

示例8: ReadObjectDestroyUpdate

 private void ReadObjectDestroyUpdate(StreamHandler Reader)
 {
     uint nObjects = Reader.ReadUInt32();
     for (var i = 0; i < nObjects; ++i)
         m_destroyedObjects.Add(Reader.ReadPackedGuid());
 }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:6,代码来源:UpdateData.cs

示例9: MonsterMove

        public MonsterMove(StreamHandler Reader, bool LazyReading)
        {
            this.Unit = Reader.ReadPackedGuid();

            this.Reader = Reader;

            m_readers = new Action[]
                {
                    ReadMovementData
                };

            if (!LazyReading)
                EnsureRead();
        }
开发者ID:SkyFire,项目名称:Kamilla.Wow,代码行数:14,代码来源:MonsterMove.cs

示例10: Read

        public void Read(StreamHandler Reader)
        {
            Slot = Reader.ReadByte();
            Spell = Reader.ReadUInt32();

            Caster = Unit;

            if (Spell != 0)
            {
                Flags = (AuraFlags)Reader.ReadUInt16();
                Level = Reader.ReadByte();
                Charges = Reader.ReadByte();

                if ((Flags & AuraFlags.NotCaster) == 0)
                    Caster = Reader.ReadPackedGuid();

                if ((Flags & AuraFlags.Duration) != 0)
                {
                    MaxDuration = Reader.ReadUInt32();
                    var currentDurationMs = Reader.ReadUInt32();

                    this.AppliedTime = (uint)Environment.TickCount - currentDurationMs;
                }

                if ((Flags & AuraFlags.BasePoints) != 0)
                {
                    for (int i = 0; i < MaxEffects; ++i)
                    {
                        if ((Flags & (AuraFlags)(1 << i)) != 0)
                            BasePoints[i] = Reader.ReadInt32();
                        else
                            BasePoints[i] = 0;
                    }
                }
                else
                    Array.Clear(BasePoints, 0, MaxEffects);
            }
        }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:38,代码来源:Aura.cs


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