From fd72029f07e8e203547316eb121b47e33b908ac4 Mon Sep 17 00:00:00 2001 From: Peter Eliasson Date: Mon, 26 Jan 2015 19:43:24 +0100 Subject: [PATCH] Added getters for NameById for guild, zone, diff and encounter to highscore API. --- src/highscore.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/highscore.lua b/src/highscore.lua index bad7bdc..a6d947b 100644 --- a/src/highscore.lua +++ b/src/highscore.lua @@ -319,6 +319,35 @@ function highscore:GetGuilds() return guildNames, numGuilds; end +-- Returns the name stored for the encounter id, or nil +-- if no encounters with that id. +function highscore:GetEncounterNameById(encounterId) + return self.db.encounters[encounterId].encounterName; +end + +-- Returns the name stored for the difficulty id, or nil +-- if no difficulty with that id. +function highscore:GetDifficultyNameById(difficultyId) + return self.db.difficulties[difficultyId].difficultyName; +end + +-- Returns the name stored for the zone id, or nil +-- if no zone with that id. +function highscore:GetZoneNameById(zoneId) + return self.db.zones[zoneId].zoneName; +end + +-- Returns the name stored for the guild id, or nil +-- if no guild with that id. +function highscore:GetGuildNameById(guildId) + -- As our implementation uses the guild name as + -- id, we will simply return the value passed in. + -- Checking for actual existance is not easy due + -- to aceDB defaults and is therefor not done. + + return guildId; +end + function highscore:OnEnable() self.db = addon.db.realm.modules["highscore"]; -- 1.7.9.5