예제 #1
0
        /// <summary>
        /// Parses skill related data
        /// </summary>
        private void ParseSkillData(Stream stream)
        {
            var apiController = new GW2APIController();

            using (var reader = CreateReader(stream))
            {
                // 4 bytes: player count
                int skillCount = reader.ReadInt32();
                //TempData["Debug"] += "Skill Count:" + skill_count.ToString();
                // 68 bytes: each skill
                for (int i = 0; i < skillCount; i++)
                {
                    // 4 bytes: skill ID
                    int skillId = reader.ReadInt32();

                    // 64 bytes: name
                    var name = ParseHelper.GetString(stream, 64);
                    if (skillId != 0 && int.TryParse(name, out int n) && n == skillId)
                    {
                        //was it a known buff?
                        if (Boon.BoonsByIds.TryGetValue(skillId, out Boon boon))
                        {
                            name = boon.Name;
                        }
                    }
                    //Save

                    var skill = new SkillItem(skillId, name);

                    skill.SetGW2APISkill(apiController);
                    _skillData.Add(skill);
                }
            }
        }
예제 #2
0
        public static void ReadSkillData(ContentManager Content)
        {
            string[] filenames = Directory.GetFiles(@"Content\Game\Skills", "*.xnb");

            foreach (string name in filenames)
            {
                string    filename = @"Game\Skills\" + Path.GetFileNameWithoutExtension(name);
                SkillData data     = Content.Load <SkillData>(filename);
                SkillData.Add(data.Name, data);
            }
        }
        /// <summary>
        /// Parses skill related data
        /// </summary>
        private void ParseSkillData(BinaryReader reader, ParserController operation)
        {
            // 4 bytes: player count
            uint skillCount = reader.ReadUInt32();

            operation.UpdateProgressWithCancellationCheck("Skill Count " + skillCount);
            //TempData["Debug"] += "Skill Count:" + skill_count.ToString();
            // 68 bytes: each skill
            for (int i = 0; i < skillCount; i++)
            {
                // 4 bytes: skill ID
                int skillId = reader.ReadInt32();
                // 64 bytes: name
                string name = GetString(reader, 64);
                //Save
                _skillData.Add(skillId, name);
            }
        }
 /// <summary>
 /// Parses skill related data
 /// </summary>
 private void ParseSkillData(Stream stream)
 {
     using (BinaryReader reader = CreateReader(stream))
     {
         // 4 bytes: player count
         uint skillCount = reader.ReadUInt32();
         //TempData["Debug"] += "Skill Count:" + skill_count.ToString();
         // 68 bytes: each skill
         for (int i = 0; i < skillCount; i++)
         {
             // 4 bytes: skill ID
             int skillId = reader.ReadInt32();
             // 64 bytes: name
             string name = ParseHelper.GetString(stream, 64);
             //Save
             var skill = new SkillItem(skillId, name);
             _skillData.Add(skill);
         }
     }
 }
예제 #5
0
 /// <summary>
 /// Parses skill related data
 /// </summary>
 private void ParseSkillData(Stream stream, ParserController operation)
 {
     using (BinaryReader reader = CreateReader(stream))
     {
         // 4 bytes: player count
         uint skillCount = reader.ReadUInt32();
         operation.UpdateProgressWithCancellationCheck("Skill Count " + skillCount);
         //TempData["Debug"] += "Skill Count:" + skill_count.ToString();
         // 68 bytes: each skill
         for (int i = 0; i < skillCount; i++)
         {
             // 4 bytes: skill ID
             int skillId = reader.ReadInt32();
             // 64 bytes: name
             string name = ParserHelper.GetString(stream, 64);
             //Save
             var skill = new SkillItem(skillId, name);
             _skillData.Add(skill);
         }
     }
 }