本文整理汇总了C#中BitReader.ReadUInt16方法的典型用法代码示例。如果您正苦于以下问题:C# BitReader.ReadUInt16方法的具体用法?C# BitReader.ReadUInt16怎么用?C# BitReader.ReadUInt16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitReader
的用法示例。
在下文中一共展示了BitReader.ReadUInt16方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ItemAction
// Methods
public ItemAction(byte[] data)
: base(data)
{
this.superiorType = SuperiorItemType.NotApplicable;
this.charClass = CharacterClass.NotApplicable;
this.level = -1;
this.usedSockets = -1;
this.use = -1;
this.graphic = -1;
this.color = -1;
this.stats = new List<StatBase>();
this.unknown1 = -1;
this.runewordID = -1;
this.runewordParam = -1;
BitReader br = new BitReader(data, 1);
this.action = (ItemActionType) br.ReadByte();
br.SkipBytes(1);
this.category = (ItemCategory) br.ReadByte();
this.uid = br.ReadUInt32();
if (data[0] == 0x9d)
{
br.SkipBytes(5);
}
this.flags = (ItemFlags) br.ReadUInt32();
this.version = (ItemVersion) br.ReadByte();
this.unknown1 = br.ReadByte(2);
this.destination = (ItemDestination) br.ReadByte(3);
if (this.destination == ItemDestination.Ground)
{
this.x = br.ReadUInt16();
this.y = br.ReadUInt16();
}
else
{
this.location = (EquipmentLocation) br.ReadByte(4);
this.x = br.ReadByte(4);
this.y = br.ReadByte(3);
this.container = (ItemContainer) br.ReadByte(4);
}
if ((this.action == ItemActionType.AddToShop) || (this.action == ItemActionType.RemoveFromShop))
{
int num = ((int) this.container) | 0x80;
if ((num & 1) == 1)
{
num--;
this.y += 8;
}
this.container = (ItemContainer) num;
}
else if (this.container == ItemContainer.Unspecified)
{
if (this.location == EquipmentLocation.NotApplicable)
{
if ((this.Flags & ItemFlags.InSocket) == ItemFlags.InSocket)
{
this.container = ItemContainer.Item;
this.y = -1;
}
else if ((this.action == ItemActionType.PutInBelt) || (this.action == ItemActionType.RemoveFromBelt))
{
this.container = ItemContainer.Belt;
this.y = this.x / 4;
this.x = this.x % 4;
}
}
else
{
this.x = -1;
this.y = -1;
}
}
if ((this.flags & ItemFlags.Ear) == ItemFlags.Ear)
{
this.charClass = (CharacterClass) br.ReadByte(3);
this.level = br.ReadByte(7);
this.name = br.ReadString(7, '\0', 0x10);
this.baseItem = BaseItem.Get(ItemType.Ear);
}
else
{
this.baseItem = BaseItem.GetByID(this.category, br.ReadUInt32());
if (this.baseItem.Type == ItemType.Gold)
{
this.stats.Add(new SignedStat(BaseStat.Get(StatType.Quantity), br.ReadInt32(br.ReadBoolean(1) ? 0x20 : 12)));
}
else
{
this.usedSockets = br.ReadByte(3);
if ((this.flags & (ItemFlags.Compact | ItemFlags.Gamble)) == ItemFlags.None)
{
BaseStat stat;
int num2;
this.level = br.ReadByte(7);
this.quality = (ItemQuality) br.ReadByte(4);
if (br.ReadBoolean(1))
{
this.graphic = br.ReadByte(3);
}
if (br.ReadBoolean(1))
//.........这里部分代码省略.........