Ejemplo n.º 1
0
        public static ClassSkill Read(byte b)
        {
            ClassSkill classSkill = new ClassSkill();

            classSkill.Points = b;
            return(classSkill);
        }
Ejemplo n.º 2
0
 public static byte[] Write(ClassSkill classSkill)
 {
     using (BitWriter writer = new BitWriter())
     {
         writer.WriteByte(classSkill.Points);
         return(writer.ToArray());
     }
 }
Ejemplo n.º 3
0
 public static byte[] Write(ClassSkills classSkills)
 {
     using (BitWriter writer = new BitWriter())
     {
         writer.WriteUInt16(classSkills.Header ?? (UInt16)0x6669);
         for (int i = 0; i < 30; i++)
         {
             writer.WriteBytes(ClassSkill.Write(classSkills.Skills[i]));
         }
         return(writer.ToArray());
     }
 }
Ejemplo n.º 4
0
        public static ClassSkills Read(byte[] bytes, int playerClass)
        {
            ClassSkills classSkills = new ClassSkills();

            using (BitReader reader = new BitReader(bytes))
            {
                classSkills.Header = reader.ReadUInt16();
                uint offset = SKILL_OFFSETS[playerClass];
                for (uint i = 0; i < 30; i++)
                {
                    ClassSkill skill = ClassSkill.Read(reader.ReadByte());
                    skill.Id = offset + i;
                    classSkills.Skills.Add(skill);
                }
                return(classSkills);
            }
        }