Player class. Written for OOP Review. Derived from life_entity.

Dependents:   life_entity

player.h

Committer:
Nakor
Date:
2011-03-31
Revision:
0:7c89d9ec2d76
Child:
1:2548417420a3

File content as of revision 0:7c89d9ec2d76:

#ifndef _PLAYERENTITY_
#define _PLAYERENTITY_

#include "mbed.h"
#include "life_entity.h"

#define DEBUG_PLAYER 0x01



class player : public life_entity
{

public:

    // Constructor
    player();
    
    // Return the player's experience point count
    unsigned long int getExperience();
    
    // Return player's current level
    char getLevel();
    
    // Check experience with required experience
    // and level up if needed/possible
    void isLevelUp();
    
    // Add experience points
    void addExperience();
    
    // Display entire experience ramp
    void displayExpRamp();
    
    // Incoming damage
    virtual void takeDamage(int roll);
    
    // Communicate info about current enemy
    void setCurrentEnemy(int health, char level = 0x00);
    
    // Check to see if the player is dead
    char isDead();
        
protected:
    unsigned long int _experience; 
    
    char _enemyLevel;
    int _enemyHealth;
    
    int _baseHealth;
};

#endif