Player class. Written for OOP Review. Derived from life_entity.
Diff: player.h
- Revision:
- 0:7c89d9ec2d76
- Child:
- 1:2548417420a3
diff -r 000000000000 -r 7c89d9ec2d76 player.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/player.h Thu Mar 31 19:56:01 2011 +0000 @@ -0,0 +1,53 @@ +#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 \ No newline at end of file