本文整理汇总了C#中GenericReader.PeekInt方法的典型用法代码示例。如果您正苦于以下问题:C# GenericReader.PeekInt方法的具体用法?C# GenericReader.PeekInt怎么用?C# GenericReader.PeekInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GenericReader
的用法示例。
在下文中一共展示了GenericReader.PeekInt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.PeekInt();
switch(version)
{
case 1000:
reader.ReadInt();
m_EngravedText = reader.ReadString();
break;
}
}
示例2: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.PeekInt();
switch (version)
{
case 1000:
reader.ReadInt();
this.m_Crafter = reader.ReadMobile();
this.m_Resource = (CraftResource)reader.ReadInt();
this.m_Quality = (ItemQuality)reader.ReadInt();
break;
case 0:
// Only these two items had this base class prior to the version change
if(this is ElvenPodium ||
this is GiantReplicaAcorn)
{
reader.ReadInt();
this.m_Crafter = reader.ReadMobile();
this.m_Resource = (CraftResource)reader.ReadInt();
this.m_Quality = (ItemQuality)reader.ReadInt();
}
// If we peeked a zero here any other way we should not consume data
else
{
this.m_Crafter = null;
this.m_Resource = CraftResource.None;
this.m_Quality = ItemQuality.Normal;
}
break;
default:
throw new ArgumentException("Unhandled version number for CraftableFurniture");
}
}