本文整理匯總了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));
}