當前位置: 首頁>>代碼示例>>C#>>正文


C# BitReader.ReadByteArray方法代碼示例

本文整理匯總了C#中BitReader.ReadByteArray方法的典型用法代碼示例。如果您正苦於以下問題:C# BitReader.ReadByteArray方法的具體用法?C# BitReader.ReadByteArray怎麽用?C# BitReader.ReadByteArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BitReader的用法示例。


在下文中一共展示了BitReader.ReadByteArray方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: 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

示例2: PlayerLifeManaChange

 // Methods
 public PlayerLifeManaChange(byte[] data)
     : base(data)
 {
     BitReader reader = new BitReader(data, 1);
     this.life = reader.ReadInt32(15);
     this.mana = reader.ReadInt32(15);
     this.stamina = reader.ReadInt32(15);
     this.x = reader.ReadInt32(0x10);
     this.y = reader.ReadInt32(0x10);
     this.unknown85b = reader.ReadByteArray();
 }
開發者ID:killerbonzai,項目名稱:BlueVex2,代碼行數:12,代碼來源:GameServerPackets.cs

示例3: SetState

 // Methods
 public SetState(byte[] data)
     : base(data)
 {
     int num;
     this.unitType = (UnitType) data[1];
     this.uid = BitConverter.ToUInt32(data, 2);
     this.state = BaseState.Get(data[7]);
     this.stats = new List<StatBase>();
     BitReader reader = new BitReader(data, 8);
     Label_003E:
     num = reader.ReadInt32(9);
     if (num != 0x1ff)
     {
         BaseStat stat = BaseStat.Get(num);
         int val = reader.ReadInt32(stat.SendBits);
         if (stat.SendParamBits > 0)
         {
             int param = reader.ReadInt32(stat.SendParamBits);
             if (stat.Signed)
             {
                 this.stats.Add(new SignedStatParam(stat, val, param));
             }
             else
             {
                 this.stats.Add(new UnsignedStatParam(stat, (uint) val, (uint) param));
             }
         }
         else if (stat.Signed)
         {
             this.stats.Add(new SignedStat(stat, val));
         }
         else
         {
             this.stats.Add(new UnsignedStat(stat, (uint) val));
         }
         goto Label_003E;
     }
     this.unknownEnd = reader.ReadByteArray();
 }
開發者ID:killerbonzai,項目名稱:BlueVex2,代碼行數:40,代碼來源:GameServerPackets.cs

示例4: 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


注:本文中的BitReader.ReadByteArray方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。