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


C# BitStream.ReadUShort方法代码示例

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


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

示例1: ReadLoadInitialValues

        /// <summary>
        /// Handles <see cref="QuestInfoMessages.LoadInitialValues"/>.
        /// </summary>
        /// <param name="bs">The <see cref="BitStream"/> to read from.</param>
        void ReadLoadInitialValues(BitStream bs)
        {
            _completedQuests.Clear();
            _activeQuests.Clear();

            // Read completed quests
            var count = bs.ReadUShort();
            for (var i = 0; i < count; i++)
            {
                _completedQuests.Add(bs.ReadQuestID());
            }

            // Read Active quests
            count = bs.ReadByte();
            for (var i = 0; i < count; i++)
            {
                _activeQuests.Add(bs.ReadQuestID());
            }

            // Raise events
            OnLoaded();

            if (Loaded != null)
                Loaded.Raise(this, EventArgs.Empty);
        }
开发者ID:wtfcolt,项目名称:game,代码行数:29,代码来源:UserQuestInformation.cs

示例2: RecvSkillStartCasting_ToUser

        void RecvSkillStartCasting_ToUser(IIPSocket conn, BitStream r)
        {
            var skillType = r.ReadEnum<SkillType>();
            var castTime = r.ReadUShort();

            GameplayScreen.SkillCastProgressBar.StartCasting(skillType, castTime);
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:7,代码来源:ClientPacketHandler.cs

示例3: RecvSkillSetGroupCooldown

        void RecvSkillSetGroupCooldown(IIPSocket conn, BitStream r)
        {
            var skillGroup = r.ReadByte();
            var cooldownTime = r.ReadUShort();

            GameplayScreen.SkillCooldownManager.SetCooldown(skillGroup, cooldownTime, GetTime());
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:7,代码来源:ClientPacketHandler.cs

示例4: RecvAddStatusEffect

        void RecvAddStatusEffect(IIPSocket conn, BitStream r)
        {
            var statusEffectType = r.ReadEnum<StatusEffectType>();
            var power = r.ReadUShort();
            var secsLeft = r.ReadUShort();

            var param = new string[] {User.Name, statusEffectType.ToString(), power.ToString()};
            var message = GameMessageCollection.CurrentLanguage.GetMessage(GameMessage.CombatStatusEffectGained, param);

            GameplayScreen.StatusEffectsForm.AddStatusEffect(statusEffectType, power, secsLeft);
            GameplayScreen.AppendToChatOutput(message);
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:12,代码来源:ClientPacketHandler.cs

示例5: ReadSetGuild

        /// <summary>
        /// Reads the <see cref="GuildInfoMessages.SetGuild"/> message.
        /// </summary>
        /// <param name="r">The stream to read the message from.</param>
        void ReadSetGuild(BitStream r)
        {
            _members.Clear();
            _onlineMembers.Clear();

            InGuild = r.ReadBool();

            if (InGuild)
            {
                Name = r.ReadString();
                Tag = r.ReadString();

                var numMembers = r.ReadUShort();
                for (var i = 0; i < numMembers; i++)
                {
                    var v = r.ReadGuildMemberNameRank(null);
                    _members.Add(v);
                }

                var onlineMembers = r.ReadUShort();
                for (var i = 0; i < onlineMembers; i++)
                {
                    var name = r.ReadString();
                    SetOnlineValue(name, true);
                }

                _members.Sort();
            }

            OnGuildChanged();

            if (GuildChanged != null)
                GuildChanged.Raise(this, EventArgs.Empty);
        }
开发者ID:wtfcolt,项目名称:game,代码行数:38,代码来源:UserGuildInformation.cs

示例6: RecvAddStatusEffect

        void RecvAddStatusEffect(IIPSocket conn, BitStream r)
        {
            var statusEffectType = r.ReadEnum<StatusEffectType>();
            var power = r.ReadUShort();
            var secsLeft = r.ReadUShort();

            GameplayScreen.StatusEffectsForm.AddStatusEffect(statusEffectType, power, secsLeft);
            GameplayScreen.AppendToChatOutput(string.Format("Added status effect {0} with power {1}.", statusEffectType, power));
        }
开发者ID:wtfcolt,项目名称:game,代码行数:9,代码来源:ClientPacketHandler.cs


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