#include <player.h>
Players have their name drawn beneath them. This class also implements player-specific loading of base sprite, hair sprite and equipment sprites.
Definition at line 39 of file player.h.
Public Member Functions | |
Player (int id, int job, Map *map) | |
Constructor. | |
~Player () | |
virtual void | setName (const std::string &name) |
Set up mName to be the character's name. | |
virtual Type | getType () const |
Returns the type of the being. | |
virtual void | setGender (Gender gender) |
Sets the gender of this being. | |
void | setHairStyle (int style, int color) |
Sets the hair style and color for this player. | |
virtual void | setSprite (int slot, int id, const std::string &color="") |
Sets visible equipments for this player. | |
void | flash (int time) |
Flash the player's name. | |
void | setInParty (bool value) |
Set the player in party. | |
bool | getInParty () const |
Returns whether player is in the party. | |
virtual unsigned char | getWalkMask () const |
Gets the way the character is blocked by other objects. | |
Protected Member Functions | |
virtual Map::BlockType | getBlockType () const |
Gets the way the monster blocks pathfinding for other objects. | |
virtual void | updateCoords () |
Let the sub-classes react to a replacement. | |
Protected Attributes | |
FlashText * | mName |
Name of character. | |
Private Attributes | |
bool | mInParty |
Player::Player | ( | int | id, | |
int | job, | |||
Map * | map | |||
) |
Player::~Player | ( | ) |
Definition at line 46 of file player.cpp.
void Player::setName | ( | const std::string & | name | ) | [virtual] |
Set up mName to be the character's name.
Reimplemented from Being.
Reimplemented in LocalPlayer, and NPC.
Definition at line 51 of file player.cpp.
Being::Type Player::getType | ( | ) | const [virtual] |
Returns the type of the being.
Reimplemented from Being.
Reimplemented in NPC.
Definition at line 139 of file player.cpp.
void Player::setGender | ( | Gender | gender | ) | [virtual] |
Sets the gender of this being.
Reimplemented from Being.
Reimplemented in NPC.
Definition at line 150 of file player.cpp.
void Player::setHairStyle | ( | int | style, | |
int | color | |||
) | [virtual] |
Sets the hair style and color for this player.
Only for convenience in 0.0 client. When porting this to the trunk remove this function and call setSprite directly instead. The server should provide the hair ID and coloring in the same way it does for other equipment pieces.
Reimplemented from Being.
Definition at line 171 of file player.cpp.
void Player::setSprite | ( | int | slot, | |
int | id, | |||
const std::string & | color = "" | |||
) | [virtual] |
Sets visible equipments for this player.
Reimplemented from Being.
Definition at line 184 of file player.cpp.
void Player::flash | ( | int | time | ) |
void Player::setInParty | ( | bool | value | ) |
bool Player::getInParty | ( | ) | const [inline] |
virtual unsigned char Player::getWalkMask | ( | ) | const [inline, virtual] |
virtual Map::BlockType Player::getBlockType | ( | ) | const [inline, protected, virtual] |
void Player::updateCoords | ( | ) | [protected, virtual] |
Let the sub-classes react to a replacement.
Reimplemented from Being.
Reimplemented in NPC.
Definition at line 226 of file player.cpp.
FlashText* Player::mName [protected] |
bool Player::mInParty [private] |