Class Models.Player
The Player class is a model that maps player information.
Just like any other model, it's used to standardize the way addons interact with data related to players.
This model will grow over time as new features are implemented in the library.
Tables
models.player.viewConstants | Constants for centralizing values that are widely used in view classes. |
Methods
models.player:getCurrentPlayer () | Gets the current player information. |
models.player:setGuid (value) | Sets the Player GUID. |
models.player:setInCombat (value) | Sets the Player in combat status. |
models.player:setLevel (value) | Sets the Player level. |
models.player:setName (value) | Sets the Player name. |
models.player:setRealm (value) | Sets the Player realm. |
Metamethods
models.player:__construct () | Player constructor. |
Tables
- models.player.viewConstants
-
Constants for centralizing values that are widely used in view classes.
Fields:
- DEFAULT_BACKGROUND_TEXTURE The default background texture for windows and frames in general
Methods
- models.player:getCurrentPlayer ()
-
Gets the current player information.
This method acts as a constructor for the Player model and should not be called in a player object instance. Consider this a static builder method.
Returns:
-
Models.Player
a new Player object with the current player's information
- models.player:setGuid (value)
-
Sets the Player GUID.
Parameters:
- value string the Player's GUID
Returns:
-
Models.Player
self
- models.player:setInCombat (value)
-
Sets the Player in combat status.
Parameters:
- value boolean the Player's in combat status
Returns:
-
Models.Player
self
- models.player:setLevel (value)
-
Sets the Player level.
Parameters:
- value integer the Player's level
Returns:
-
Models.Player
self
- models.player:setName (value)
-
Sets the Player name.
Parameters:
- value string the Player's name
Returns:
-
Models.Player
self
- models.player:setRealm (value)
-
Sets the Player realm.
It's most likely that a player realm will be the same realm as the player is logged in, but it's possible to have a player from a different realm, especially in Retail, where Blizzard allows players from other realms to share the same place or group.
Parameters:
- value Models.Realm the Player's realm
Returns:
-
Models.Player
self