Protect against nil stanceList.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@795 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Use addon variables to stash references to each module.

The Ovale modules are all interdependent and unlikely to become
independent addons at any point, so use a simpler way to store references
to each module by just storing it in the addon namespace.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@796 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Code consistency.

Make local copies of all Blizzard API functions and prefix them with
"API_". This makes it simpler to automatically audit the use of Blizzard
API functions.

Rename all private static variables by adding a "self_" prefix.  This
reduces namespace conflicts with variable names when writing functions.

Rename all constants and constant tables to be in all-capitals and to
start with an "OVALE_" prefix.  This makes it clear what values are
immutable and which may be changed.

Also remove ``Ovale'' from the global namespace as a final clean-up.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@797 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Save memory by not creating many small Lua tables per frame refresh.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@798 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Enhance OvaleGUID to also track GUIDs when unitIDs change.

Use a table to hold unitID-to-GUID mappings and provide a new method
GetGUID(unitId) to access the table from other modules.

Make some public properties private and create methods to access the data
in those tables.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@799 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Rename OvaleState:GetRunes to GetRunesCooldown() and be more DRY.

Make OvaleConditions use OvaleState:GetRunesCooldown() instead of
reimplementing almost the exact same function.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@800 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Clean up implementation of time-to-die estimate.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@801 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Fix ticket #196 - DebuffPresent(Magic) wrong with Pally buffs

The problem was caused by the Buff*() and Debuff*() conditions being
aliases for each other that actually just checked every aura on a target,
regardless of whether it was a buff or a debuff, e.g., the following two
conditions returned the same result:

    DebuffPresent(Magic)
    BuffPresent(Magic)

This made it impossible to do something like the following if the player
had any dispellable raid buffs:

    if DebuffPresent(Magic) Spell(cleanse)

Fix this by splitting out the buffs and debuffs per unit into separate
lists in OvaleAura and OvaleState, and teaching all of the methods that
manipulate or reference the aura tables to take an additional ``filter''
argument that can be ``HELPFUL'' (buff), ``HARMFUL'' (debuff) or nil
(either).

Introduce a new condition parameter ``filter''.  The ``filter'' parameter
is used to narrow down the auras that Ovale inspects to check a condition.
If specified, its valid values are ``buff'', ``debuff'' or ``any'',
defaulting to ``any''.

The Buff*() and Debuff*() conditions implicitly set the filter to ``buff''
or ``debuff'', respectively.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@802 d5049fe3-3747-40f7-a4b5-f36d6801af5f