GRA RPG  DM & KK
Projekt na PO3
Archer Class Reference

Class Archer Inherits a champion. More...

#include <Archer.h>

Inheritance diagram for Archer:
Champion

Public Member Functions

 Archer (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 Archer cause a champion constructor. More...
 
virtual int attack () override
 Virtual function attack. More...
 
virtual int block () override
 Virtual function block. More...
 
virtual Archerclone () const
 Virtual function clone to clone object. 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 Archer Inherits a champion.

Constructor & Destructor Documentation

◆ Archer()

Archer::Archer ( 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 Archer cause a champion constructor.

Parameters
write- The inscription that will be shown on the button
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 Archer::attack ( )
overridevirtual

Virtual function attack.

Returns
value attack

Reimplemented from Champion.

◆ block()

int Archer::block ( )
overridevirtual

Virtual function block.

Returns
value block


Reimplemented from Champion.

◆ clone()

virtual Archer* Archer::clone ( ) const
inlinevirtual

Virtual function clone to clone object.

Returns
Pointer object Archer


Implements Champion.