本文整理汇总了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);
}
示例2: RecvSkillStartCasting_ToUser
void RecvSkillStartCasting_ToUser(IIPSocket conn, BitStream r)
{
var skillType = r.ReadEnum<SkillType>();
var castTime = r.ReadUShort();
GameplayScreen.SkillCastProgressBar.StartCasting(skillType, castTime);
}
示例3: RecvSkillSetGroupCooldown
void RecvSkillSetGroupCooldown(IIPSocket conn, BitStream r)
{
var skillGroup = r.ReadByte();
var cooldownTime = r.ReadUShort();
GameplayScreen.SkillCooldownManager.SetCooldown(skillGroup, cooldownTime, GetTime());
}
示例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);
}
示例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);
}
示例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));
}