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


C# BitReader.ReadBoolean方法代码示例

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


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

示例1: AddUnit

 // Methods
 public AddUnit(byte[] data)
     : base(data)
 {
     int num;
     int num2;
     this.unitType = (UnitType) data[1];
     this.uid = BitConverter.ToUInt32(data, 2);
     this.states = new List<NPCState>();
     BitReader reader = new BitReader(data, 7);
     Label_0030:
     num = reader.ReadInt32(8);
     if (num == 0xff)
     {
         this.offset = reader.Position;
         this.unknownEnd = reader.ReadByteArray();
         return;
     }
     if (!reader.ReadBoolean(1))
     {
         this.states.Add(new NPCState(BaseState.Get(num)));
         goto Label_0030;
     }
     List<StatBase> stats = new List<StatBase>();
     Label_0056:
     num2 = reader.ReadInt32(9);
     if (num2 != 0x1ff)
     {
         BaseStat stat = BaseStat.Get(num2);
         int val = reader.ReadInt32(stat.SendBits);
         if (stat.SendParamBits > 0)
         {
             int param = reader.ReadInt32(stat.SendParamBits);
             if (stat.Signed)
             {
                 stats.Add(new SignedStatParam(stat, val, param));
             }
             else
             {
                 stats.Add(new UnsignedStatParam(stat, (uint) val, (uint) param));
             }
         }
         else if (stat.Signed)
         {
             stats.Add(new SignedStat(stat, val));
         }
         else
         {
             stats.Add(new UnsignedStat(stat, (uint) val));
         }
         goto Label_0056;
     }
     this.states.Add(new NPCState(BaseState.Get(num), stats));
     goto Label_0030;
 }
开发者ID:killerbonzai,项目名称:BlueVex2,代码行数:55,代码来源:GameServerPackets.cs

示例2: UpdateItemStats

 // Methods
 public UpdateItemStats(byte[] data)
     : base(data)
 {
     this.stats = new List<StatBase>();
     this.unknown61b = -1;
     this.unknown78b = -1;
     BitReader reader = new BitReader(data, 1);
     this.unknown8b = reader.ReadInt32(10);
     this.uid = reader.ReadUInt32();
     while (reader.ReadBoolean(1))
     {
         BaseStat stat = BaseStat.Get(reader.ReadInt32(9));
         this.unknown60b = reader.ReadInt32(1);
         if (stat.Type == StatType.ChargedSkill)
         {
             this.unknown61b = reader.ReadInt32(1);
             int charges = reader.ReadInt32(8);
             int maxCharges = reader.ReadInt32(8);
             this.unknown78b = reader.ReadInt32(1);
             int level = reader.ReadInt32(6);
             int skill = reader.ReadInt32(10);
             this.stats.Add(new ChargedSkillStat(stat, level, skill, charges, maxCharges));
         }
         else
         {
             if (stat.Signed)
             {
                 this.stats.Add(new SignedStat(stat, reader.ReadInt32(stat.SendBits)));
                 continue;
             }
             this.stats.Add(new UnsignedStat(stat, reader.ReadUInt32(stat.SendBits)));
         }
     }
     this.offset = reader.Position;
     this.unknownEnd = reader.ReadByteArray();
 }
开发者ID:killerbonzai,项目名称:BlueVex2,代码行数:37,代码来源:GameServerPackets.cs

示例3: 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))
//.........这里部分代码省略.........
开发者ID:killerbonzai,项目名称:BlueVex2,代码行数:101,代码来源:GameServerPackets.cs


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