-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "boss.hpp" | ||
|
||
Boss::Boss(char const* _name, unsigned _score, | ||
char const* _algorithm, double _threshold, | ||
unsigned _level, unsigned _difficulty, unsigned _damage) | ||
: Hero(_name, _score, _level), | ||
Bot(_name, _score, _algorithm, _threshold, _difficulty), | ||
damage(_damage) {} | ||
|
||
void Boss::print(std::ostream& os) const { | ||
Bot::print(os); | ||
std::cout << " и е бос, който е "; | ||
Hero::print(os); | ||
std::cout << " и нанася щети " << getDamage() << std::endl; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef __BOSS_HPP | ||
#define __BOSS_HPP | ||
#include "hero.hpp" | ||
#include "bot.hpp" | ||
|
||
class Boss : public Hero, public Bot { | ||
unsigned damage; | ||
public: | ||
Boss(char const* _name = "<някакъв бос>", unsigned _score = 0, | ||
char const* _algorithm = "<неизвестен алгоритъм>", double _threshold = 0.1, | ||
unsigned _level = 20, unsigned _difficulty = 1, unsigned _damage = 10); | ||
|
||
unsigned getDamage() const { return damage; } | ||
|
||
void print(std::ostream& os = std::cout) const; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters