コード例 #1
0
        public List <AchievementInfo> GetAchievements()
        {
            Log("Fetching achievements");
            List <AchievementInfo>      achievementList = new List <AchievementInfo>();
            IDictionary <ulong, string> heroItemMapping = GetHeroItemMapping();

            Log("Mapping achievement data \n");

            foreach (ulong key in TrackedFiles[0x68])
            {
                STUAchievement achievement = GetInstance <STUAchievement>(key);
                if (achievement == null)
                {
                    continue;
                }

                string   name   = GetString(achievement.Name);
                string   desc   = GetString(achievement.Description);
                string   group  = achievement.Category.ToString();
                ItemInfo item   = GatherUnlock(achievement.Reward);
                Reward   reward = new Reward(achievement.Reward, item.Name, item.Type, item.Rarity);
                heroItemMapping.TryGetValue(item.GUID, out string hero);

                achievementList.Add(new AchievementInfo(key, name, group, desc, hero, reward));
            }

            return(achievementList);
        }
コード例 #2
0
        public Achievement(ulong key)
        {
            STUAchievement stu = GetInstance <STUAchievement>(key);

            if (stu == null)
            {
                return;
            }
            Init(stu, key);
        }
コード例 #3
0
        public Achievement(STUAchievement achievement)
        {
            Name        = GetString(achievement.m_name);
            Description = GetString(achievement.m_description);

            Trophy     = achievement.m_trophy;
            Category   = achievement.m_category;
            GamerScore = achievement.m_gamerScore;

            if (achievement.m_unlock != 0)
            {
                Reward = new Unlock(achievement.m_unlock);
            }
        }
コード例 #4
0
        public void Init(STUAchievement achievement, ulong key = default)
        {
            GUID            = (teResourceGUID)key;
            Name            = GetString(achievement.m_name);
            AchievementName = achievement.m_4E291DCC.Value;
            Description     = GetString(achievement.m_description);

            //Trophy = achievement.m_trophy;
            //Category = achievement.m_category;
            GamerScore = achievement.m_gamerScore;

            if (achievement.m_unlock != 0)
            {
                Reward = new Unlock(achievement.m_unlock);
            }
        }
コード例 #5
0
        public List <Achievement> GetAchievements()
        {
            List <Achievement> achievements = new List <Achievement>();

            foreach (ulong key in TrackedFiles[0x68])
            {
                STUAchievement achievement = GetInstance <STUAchievement>(key);
                if (achievement == null)
                {
                    continue;
                }

                Achievement model = new Achievement(achievement);
                achievements.Add(model);
            }

            return(achievements);
        }
コード例 #6
0
 public Achievement(STUAchievement stu)
 {
     Init(stu);
 }