Mage: Apply more fixes after SimulationCraft import.

The buff from standing in Rune of Power has a different ID than the spell.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@771 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Make code more DRY: get class and player GUID from the proper modules.

Use OvalePaperDoll.class and OvaleGUID.player instead of calling
UnitClass() and UnitGUID() in various modules that need the information.

Make playerGUID private in the modules that use it since it isn't accessed
outside of the individual modules.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@772 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Move specialization tracking from OvaleStance to OvalePaperDoll.

The class specialization/mastery isn't really stance-related, whereas it's
available in the in-game paper doll.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@773 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Make some more unnecessarily public variables private.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@774 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Add simple memory pool implementation in OvalePool.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@775 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Use OvalePool to reduce memory usage in OvaleCompile.

Create a pool of nodes that are used (and reused) by the parser when
creating the abstract syntax tree for the script.  This bounds the memory
used by OvaleCompile instead of letting the garbage collector reclaim
unused memory.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@776 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Use OvalePool to reduce memory usage in OvaleAura.

Create a pool of auras that are used (and reused) when recording the auras
present on a unit.  This bounds the memory used by OvaleAura instead of
letting the garbage collector reclaim unused memory.

Don't pass around tables between modules; this decreases linkage between
modules by not exposing internal data structures and improves overall
encapsulation.

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

* Functions should start with a capital letter.
* Lua coding style nit: use ``tinsert'' instead of ``a[#a+1] = ...''.
* Remove unnecesary bookkeeping in OvaleCompile that was only used in a
  rare debugging event.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@778 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Remove all addon variables from the global namespace.

The only addon variable left in the global namespace is ``Ovale'', which
represents the main addon object.

This change also makes explicit the dependencies between modules. Reorder
Lua files in the TOC file to ensure module dependencies are met.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@779 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Fix OvaleEnemies to track the number of enemies correctly.

Before this change, the enemies table was not being updated properly when
UNIT_DIED was received.

Split out the routines to add and remove enemies into public methods to
make the code more DRY.

API change: Remove method GetNumberOfEnemies() and introduce a public
static variable ``activeEnemies'' that holds the number of active enemies.

Schedule a timer to remove enemies that haven't been active for at least 3
seconds.  These are either not in combat with your group, out of range, or
incapacitated and shouldn't count toward your active enemies.

When a unit is no longer an active enemy, throw a new Ovale event
``Ovale_InactiveUnit'' that has the GUID of the dead unit as an event
parameter.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@780 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Improve encapsulation of OvaleAura and reduce memory usage.

Make the ``auras'' table and the ``serial'' variable private.

Catch ``Ovale_InactiveUnit'' and remove auras for any inactive units as
well as for dead ones.  This reduces the memory used by Ovale to track
auras on units.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@781 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Prune auras from GUIDs that are no longer in the group.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@782 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Guard against bad slot names to GetEquippedItem().

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@783 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Query OvaleEquipement for equipped items in slots for efficiency.

git-svn-id: svn+ssh://svn.curseforge.net/wow/ovale/mainline/trunk@784 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Set the frame anchor during UpdateFrame() instead of OnInitialize().

This moves referencing the anchor stored in the profile to a later point
where if the profile is changed, the anchor in the new profile is used to
update the frame, and is needed for online profile-switching.

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