GRA RPG  DM & KK
Projekt na PO3
Champion Class Referenceabstract

Class Champion use to create character. More...

#include <Champion.h>

Inheritance diagram for Champion:
Archer Monster Warrior Wizzard

Public Member Functions

 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...
 
virtual int attack ()
 Virtual function attack. More...
 
virtual int block ()
 Virtual function block. More...
 
int heal ()
 Function return Helath the value to heal the hero. More...
 
void setHealth (int hp)
 Function set Health. More...
 
virtual Championclone () const =0
 Virtual method clone copy pointer. 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...
 

Protected Attributes

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
 

Friends

std::ostream & operator<< (std::ostream &out, const Champion &p)
 Showing a value represent champion. More...
 

Detailed Description

Class Champion use to create character.

Constructor & Destructor Documentation

◆ Champion()

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.

Parameters
write- The inscription that will be shown on the button


Parameters
id- Id champion in database


Parameters
n- Name champion


Parameters
l- Level champion


Parameters
e- Experience champion


Parameters
m- Money champion


Parameters
he- Health champion


Parameters
st- Strength champion


Parameters
de- Dexerity Champion


Parameters
ma- Magic champion


Parameters
def- Defence champion


Parameters
lu- Lucky champion

Member Function Documentation

◆ addDefence()

void Champion::addDefence ( int  def)
inline

Function add Health.

Parameters
hp- Value to addition to health

◆ addDexterity()

void Champion::addDexterity ( int  dex)
inline

Function add Dexterity.

Parameters
hp- Value to addition to Dexterity/param>

◆ addExperience()

void Champion::addExperience ( int  exp)

Function add Experience.

Parameters
hp- Value to addition to experience


◆ addHealth()

void Champion::addHealth ( int  hp)
inline

Function add Health.

Parameters
hp- Value to addition to health


◆ addLuck()

void Champion::addLuck ( int  luc)
inline

Function add Lucky.

Parameters
hp- Value to addition to lucky

◆ addMagic()

void Champion::addMagic ( int  mag)
inline

Function add Magic.

Parameters
hp- Value to addition to magic

◆ addMoney()

void Champion::addMoney ( int  mon)
inline

Function add Money.

Parameters
hp- Value to addition to Money


◆ addStrength()

void Champion::addStrength ( int  stren)
inline

Function add Strength.

Parameters
hp- Value to addition to strength


◆ attack()

virtual int Champion::attack ( )
inlinevirtual

Virtual function attack.

Reimplemented in Warrior, Monster, Archer, and Wizzard.

◆ block()

virtual int Champion::block ( )
inlinevirtual

Virtual function block.

Reimplemented in Warrior, Monster, and Archer.

◆ clone()

virtual Champion* Champion::clone ( ) const
pure virtual

Virtual method clone copy pointer.

Implemented in Monster, Archer, Wizzard, and Warrior.

◆ getDefence()

int Champion::getDefence ( )
inline

Get Defence.

Returns
Experience

◆ getDexterity()

int Champion::getDexterity ( )
inline

Get Dexterity.

Returns
Dexterity

◆ getExperince()

int Champion::getExperince ( )
inline

Get Experience.

Returns
Experience

◆ getHealth()

int Champion::getHealth ( ) const
inline

Function get Health champion.

◆ getId()

int Champion::getId ( )
inline

Get Id.

Returns
Id champion

◆ getLevel()

int Champion::getLevel ( )
inline

Get Level.

Returns
Level

◆ getLuck()

int Champion::getLuck ( )
inline

Get Lucky.

Returns
Lucky

◆ getMagic()

int Champion::getMagic ( )
inline

Get Magic.

Returns
Magic

◆ getMoney()

int Champion::getMoney ( )
inline

Get Money.

Returns
Money

◆ getName()

std::string Champion::getName ( )
inline

Function get Name champion.

◆ getStrength()

int Champion::getStrength ( )
inline

Get Strength.

Returns
Strength

◆ heal()

int Champion::heal ( )

Function return Helath the value to heal the hero.

◆ setHealth()

void Champion::setHealth ( int  hp)
inline

Function set Health.

Parameters
hp- Helth champion


◆ takeMoney()

void Champion::takeMoney ( double  mon)

Function add Money.

Parameters
hp- Value to addition to money

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const Champion p 
)
friend

Showing a value represent champion.

Member Data Documentation

◆ defence

int Champion::defence
protected

◆ dexterity

int Champion::dexterity
protected

◆ experience

unsigned int Champion::experience
protected

◆ health

int Champion::health
protected

◆ id_champion

const unsigned int Champion::id_champion
protected

◆ level

unsigned int Champion::level
protected

◆ luck

int Champion::luck
protected

◆ magic

int Champion::magic
protected

◆ money

double Champion::money
protected

◆ name

const std::string Champion::name
protected

◆ strength

int Champion::strength
protected