Framework
Object Manager
The Object Manager is a table that contains all the players, units, and objects currently in the game world that are visible to the player. You can access the Object Manager using the _A.OM
global variable. There are several sub-tables within the Object Manager that contain units of a specific type.
_A.OM = {
All = {},
Enemy = {},
EnemyCombat = {},
Friendly = {},
Roster = {},
Dead = {},
Critters = {},
Object = {},
GameObject = {},
DynamicObject = {},
}
Object Manager Tables
The Object Manager contains the following tables:
All
- All of the follow.
Enemy
- All enemies units.
EnemyCombat
- All enemies units currently in combat with the Roster.
Friendly
- All friendly units.
Roster
- All members of the player's group.
Dead
- All dead units.
Critters
- All critters units.
Object
- All objects.
GameObject
- All the game objects.
DynamicObject
- All the dynamic objects.
And for example if you want to iterate the Roster
table:
local roster = _A.OM:Get('Roster')
for _,Obj in pairs(roster) do
print( Obj.key )
print( Obj.guid )
print( Obj.name )
print( Obj:Distance() )
print( Obj:HealthRaw() )
print( Obj:HealthMax() )
print( Obj:Health() )
end
Object Manager Methods
The Object Manager contains the following methods:
Get
- Returns a table of units that match the provided condition. For example if you do
local playerObject = _A.OM:Get("Roster")[UnitGUID("player")]
or
local playerObject = _A.OM["Roster"][UnitGUID("player")]
The table containing the player
object is assigned to the playerObject variable that way you dont need to iterate to get the player object