GRA RPG  DM & KK
Projekt na PO3
Warrior Class Reference

Class Warrior Inherits a champion. More...

#include <Warrior.h>

Inheritance diagram for Warrior:
Champion

Public Member Functions

 Warrior (const unsigned id, const std::string n, unsigned int l, unsigned int e, double m, int he, int st, int de, int ma, int def, int lu)
 Constructor Warrior cause a champion constructor. More...
 
virtual Warriorclone () const
 Virtual function clone to clone object. More...
 
virtual int attack () override
 Virtual function attack. More...
 
virtual int block () override
 Virtual function block. More...
 
- Public Member Functions inherited from Champion
 Champion (const unsigned id, const std::string n, unsigned int l, unsigned int e, double m, int he, int st, int de, int ma, int def, int lu)
 Constructor Champion. More...
 
int heal ()
 Function return Helath the value to heal the hero. More...
 
void setHealth (int hp)
 Function set Health. More...
 
int getHealth () const
 Function get Health champion. More...
 
std::string getName ()
 Function get Name champion. More...
 
void addHealth (int hp)
 Function add Health. More...
 
void addStrength (int stren)
 Function add Strength. More...
 
void addDexterity (int dex)
 Function add Dexterity. More...
 
void addMagic (int mag)
 Function add Magic. More...
 
void addDefence (int def)
 Function add Health. More...
 
void addLuck (int luc)
 Function add Lucky. More...
 
void addMoney (int mon)
 Function add Money. More...
 
void addExperience (int exp)
 Function add Experience. More...
 
void takeMoney (double mon)
 Function add Money. More...
 
int getId ()
 Get Id. More...
 
int getExperince ()
 Get Experience. More...
 
int getLevel ()
 Get Level. More...
 
int getMoney ()
 Get Money. More...
 
int getStrength ()
 Get Strength. More...
 
int getDexterity ()
 Get Dexterity. More...
 
int getMagic ()
 Get Magic. More...
 
int getDefence ()
 Get Defence. More...
 
int getLuck ()
 Get Lucky. More...
 

Additional Inherited Members

- Protected Attributes inherited from Champion
const unsigned int id_champion
 
const std::string name
 
unsigned int level
 
unsigned int experience
 
double money
 
int health
 
int strength
 
int dexterity
 
int magic
 
int defence
 
int luck
 

Detailed Description

Class Warrior Inherits a champion.

Constructor & Destructor Documentation

◆ Warrior()

Warrior::Warrior ( const unsigned  id,
const std::string  n,
unsigned int  l,
unsigned int  e,
double  m,
int  he,
int  st,
int  de,
int  ma,
int  def,
int  lu 
)
inline

Constructor Warrior cause a champion constructor.

Parameters
id- Id champion in database
n- Name champion
l- Level champion
e- Experience champion
m- Money champion
he- Health champion
st- Strength champion
de- Dexerity Champion
ma- Magic champion
def- Defence champion
lu- Lucky champion

Member Function Documentation

◆ attack()

int Warrior::attack ( )
overridevirtual

Virtual function attack.

Returns
value attack

Reimplemented from Champion.

◆ block()

int Warrior::block ( )
overridevirtual

Virtual function block.

Returns
value block


Reimplemented from Champion.

◆ clone()

virtual Warrior* Warrior::clone ( ) const
inlinevirtual

Virtual function clone to clone object.

Returns
Pointer object Warrior


Implements Champion.