From 640798cfe92af977690ef30a9e6b34d983a67370 Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Tue, 12 Mar 2013 04:47:23 +0000 Subject: [PATCH] Improve encapsulation of OvaleData. Split out OvaleData:GetComputedSpellCD() into a new method GetSpellCD() which queries the Blizzard API, and a second portion moved to OvaleState:GetComputedSpellCD() that checks the frame state for any spell CDs found there. This de-couples OvaleData from OvaleState. Use OvaleState:GetComputedSpellCD() in place of the removed OvaleData:GetComputedSpellCD() in the various Ovale modules. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@757 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleBestAction.lua | 2 +- OvaleCondition.lua | 4 ++-- OvaleData.lua | 42 ++++++++++++------------------------------ OvaleState.lua | 14 ++++++++++++++ 4 files changed, 29 insertions(+), 33 deletions(-) diff --git a/OvaleBestAction.lua b/OvaleBestAction.lua index ea049d3..afe85df 100644 --- a/OvaleBestAction.lua +++ b/OvaleBestAction.lua @@ -102,7 +102,7 @@ function OvaleBestAction:GetActionInfo(element) return nil end - actionCooldownStart, actionCooldownDuration, actionEnable = OvaleData:GetComputedSpellCD(spellId) + actionCooldownStart, actionCooldownDuration, actionEnable = OvaleState:GetComputedSpellCD(spellId) if not actionCooldownStart or not actionCooldownDuration then Ovale:debugPrint("unknown_spells", "No cooldown data for spell "..spellId) end diff --git a/OvaleCondition.lua b/OvaleCondition.lua index 1051272..b42f6f1 100644 --- a/OvaleCondition.lua +++ b/OvaleCondition.lua @@ -718,7 +718,7 @@ end -- returns: bool OvaleCondition.conditions.cancast = function(condition) local name, rank, icon, cost, isFunnel, powerType, castTime = OvaleData:GetSpellInfoOrNil(condition[1]) - local actionCooldownStart, actionCooldownDuration, actionEnable = OvaleData:GetComputedSpellCD(condition[1]) + local actionCooldownStart, actionCooldownDuration, actionEnable = OvaleState:GetComputedSpellCD(condition[1]) local startCast = actionCooldownStart + actionCooldownDuration if startCast