adding cs142 code
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
#ifndef __FIGHTER_H__
|
||||
#define __FIGHTER_H__
|
||||
|
||||
#include <ostream>
|
||||
#include "FighterInterface.h"
|
||||
|
||||
class fighter : public FighterInterface
|
||||
{
|
||||
private:
|
||||
string name;
|
||||
|
||||
protected:
|
||||
int max_hp;
|
||||
int hp;
|
||||
int strength;
|
||||
int speed;
|
||||
int magic;
|
||||
|
||||
public:
|
||||
fighter(string, int, int, int, int);
|
||||
// virtual ~fighter();
|
||||
|
||||
string getName();
|
||||
|
||||
int getMaximumHP();
|
||||
int getCurrentHP();
|
||||
int getStrength();
|
||||
int getSpeed();
|
||||
int getMagic();
|
||||
|
||||
virtual string get_type() = 0;
|
||||
|
||||
virtual int getDamage() = 0;
|
||||
void takeDamage(int damage);
|
||||
virtual void reset() = 0;
|
||||
virtual void regenerate();
|
||||
virtual bool useAbility() = 0;
|
||||
|
||||
bool isSimplified();
|
||||
|
||||
friend ostream & operator<<(ostream & os, fighter & a);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user