Player Class Reference

#include <player.h>

List of all members.

Public Member Functions

 Player ()
 ~Player ()
ez::Point getPosition () const
ez::Point getOldPosition () const
unsigned int getAR () const
unsigned int getDR () const
unsigned int getXP () const
unsigned int getPlayerLevel () const
bool getAlive () const
unsigned int getLevel () const
bool getMove () const
int getHP () const
void setKeyRepeat (bool repeater)
void setPosition (ez::Point p)
void incrementXP (unsigned int xp)
void decrementHP (unsigned int h)
void update (const Key &keyInput, ez::tile onTile, const Dungeon &dungeon)

Constructor & Destructor Documentation

Player::Player (  ) 

Instatiates a Player object.

Player::~Player (  ) 

Member Function Documentation

void Player::decrementHP ( unsigned int  h  )  [inline]

Decrement a player's hp when they are hit by a monster.

Parameters:
h The player loses this amount of hitpoints.
bool Player::getAlive (  )  const [inline]

Gets a bool of whether the player is still alive.

unsigned int Player::getAR (  )  const [inline]

Gets an unsigned int of the player's attack rating.

unsigned int Player::getDR (  )  const [inline]

Gets an unsigned int of the player's defense rating.

int Player::getHP (  )  const [inline]

Returns an int of the player's hit points.

unsigned int Player::getLevel (  )  const [inline]

Gets the player's level in the dungeon.

bool Player::getMove (  )  const [inline]

Returns a bool of whether or not the player has moved this frame. Used as a trigger to update monsters.

ez::Point Player::getOldPosition (  )  const [inline]

Gets the ez::Point of the player position before the update function is called.

unsigned int Player::getPlayerLevel (  )  const [inline]

Gets the player's level of their character. Higher level => more powerful character.

ez::Point Player::getPosition (  )  const [inline]

Gets the ez::Point of the player position.

unsigned int Player::getXP (  )  const [inline]

Gets the player's experience points.

void Player::incrementXP ( unsigned int  xp  )  [inline]

Increments player's xp.

Can be used when player kills a monster, for example.

Parameters:
xp Player's experience points are incremented by this value.
void Player::setKeyRepeat ( bool  repeater  ) 

Sets whether keyboard repeat is used for player's input.

Parameters:
repeater If set to true, a player can hold down a movement key and move in that direction for as long as the key is held down.
void Player::setPosition ( ez::Point  p  )  [inline]

Can set the players position.

Parameters:
p The player's position is set to ez::Point p.
void Player::update ( const Key keyInput,
ez::tile  onTile,
const Dungeon dungeon 
)

Update function for the player.

Processes player movement, checks to see if he increases a level, and checks to see if player is still alive.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Enumerations Enumerator

Generated by  doxygen 1.6.2