Exemplo n.º 1
0
        internal static void InitAchievementManager(IQueryAdapter dbClient)
        {
            dbClient.setQuery("SELECT achievements.*, achievement_categories.name " +
                              "FROM achievements " +
                              "JOIN achievement_categories " +
                              "ON achievement_categories.id = achievements.category");

            DataTable dTable = dbClient.getTable();

            achievements = new Dictionary <uint, AchievementBase>();

            uint   achievementID;
            uint   levels;
            uint   badgelevel;
            string badge;
            int    pixelBase;
            int    pixelMMPORG;
            int    pixelReward;
            string category;

            foreach (DataRow dRow in dTable.Rows)
            {
                achievementID = Convert.ToUInt32(dRow[0]);
                levels        = Convert.ToUInt32(dRow[1]);
                badgelevel    = Convert.ToUInt32(dRow[2]);
                badge         = (string)dRow[3];
                pixelBase     = (int)dRow[4];
                pixelMMPORG   = (int)dRow[5];
                pixelReward   = (int)dRow[6];
                category      = (string)dRow[8];

                AchievementBase achivement = new AchievementBase(achievementID, levels, badgelevel, badge, pixelBase, pixelMMPORG, pixelReward, category);
                achievements.Add(achievementID, achivement);
            }
        }
Exemplo n.º 2
0
 public Achievement(uint id, uint achievementID, uint level, uint progress)
 {
     this.id = id;
     this.achievement = AchievementManager.GetAchivement(achievementID);
     this.progress = progress;
     this.level = level;
 }
Exemplo n.º 3
0
        internal static void InitAchievementManager(IQueryAdapter dbClient)
        {
            dbClient.setQuery("SELECT achievements.*, achievement_categories.name " +
                                "FROM achievements " +
                                "JOIN achievement_categories " +
                                "ON achievement_categories.id = achievements.category");

            DataTable dTable = dbClient.getTable();

            achievements = new Dictionary<uint, AchievementBase>();

            uint achievementID;
            uint levels;
            uint badgelevel;
            string badge;
            int pixelBase;
            int pixelMMPORG;
            int pixelReward;
            string category;
            foreach (DataRow dRow in dTable.Rows)
            {
                achievementID = Convert.ToUInt32(dRow[0]);
                levels = Convert.ToUInt32(dRow[1]);
                badgelevel = Convert.ToUInt32(dRow[2]);
                badge = (string)dRow[3];
                pixelBase = (int)dRow[4];
                pixelMMPORG = (int)dRow[5];
                pixelReward = (int)dRow[6];
                category = (string)dRow[8];

                AchievementBase achivement = new AchievementBase(achievementID, levels, badgelevel, badge, pixelBase, pixelMMPORG, pixelReward, category);
                achievements.Add(achievementID, achivement);
            }
        }
Exemplo n.º 4
0
 public Achievement(uint id, uint achievementID, uint level, uint progress)
 {
     this.id          = id;
     this.achievement = AchievementManager.GetAchivement(achievementID);
     this.progress    = progress;
     this.level       = level;
 }