Advertisement
Dawid_PAr

Untitled

Aug 13th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <ctime>
  3. #include <cmath>
  4. #include <cstdio>
  5. #include <cstring>
  6. #include <fstream>
  7. #include <sstream>
  8. using namespace std;
  9.  
  10. class Creature
  11. {
  12. public:
  13. Creature* operator + (Creature*);
  14. };
  15.  
  16.  
  17.  
  18. // TO JUZ W INNYM PLIKU
  19. Creature* Creature::operator + (Creature* target) { /// this + target
  20. bool tf = this->hit(target); // czy target żyje -> tf
  21. if (!tf) cout << target->name << " is hit critically!\n";
  22. return target;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement