Player Class Reference

#include <player.h>

Inheritance diagram for Player:

Being LocalPlayer NPC

List of all members.


Detailed Description

A player being.

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

FlashTextmName
 Name of character.

Private Attributes

bool mInParty

Constructor & Destructor Documentation

Player::Player ( int  id,
int  job,
Map map 
)

Constructor.

Definition at line 40 of file player.cpp.

Player::~Player (  ) 

Definition at line 46 of file player.cpp.


Member Function Documentation

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  ) 

Flash the player's name.

Definition at line 144 of file player.cpp.

void Player::setInParty ( bool  value  ) 

Set the player in party.

Definition at line 280 of file player.cpp.

bool Player::getInParty (  )  const [inline]

Returns whether player is in the party.

Definition at line 120 of file player.h.

virtual unsigned char Player::getWalkMask (  )  const [inline, virtual]

Gets the way the character is blocked by other objects.

Reimplemented from Being.

Reimplemented in NPC.

Definition at line 125 of file player.h.

virtual Map::BlockType Player::getBlockType (  )  const [inline, protected, virtual]

Gets the way the monster blocks pathfinding for other objects.

Reimplemented from Being.

Reimplemented in NPC.

Definition at line 132 of file player.h.

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.


Member Data Documentation

FlashText* Player::mName [protected]

Name of character.

Reimplemented from Being.

Reimplemented in NPC.

Definition at line 142 of file player.h.

bool Player::mInParty [private]

Definition at line 145 of file player.h.


The documentation for this class was generated from the following files:

Generated on Sun Apr 26 17:30:43 2009 for The Mana World by  doxygen 1.5.5