Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.16 KB | None | 0 0
  1. #ifndef MONSTER_H
  2. #define MONSTER_H
  3.  
  4. #include<iostream>
  5. #include<unordered_map>
  6. #include<stdexcept>
  7. #include<algorithm>
  8. #include<numeric>
  9. #include<iterator>
  10. #include<set>
  11. #include<vector>
  12.  
  13. using namespace std;
  14.  
  15. enum class Type{Water, Fire, Grass, Poison, Electric};
  16. const vector<string> type_names{"Water", "Fire", "Grass", "Poison", "Electric"};
  17.  
  18. class Monster{
  19.   string name;
  20.   int level;
  21.   Type type;
  22.   vector<string> attacks;
  23.  
  24.   public:
  25.     Monster(string="Squirtle", int=23, Type =Type::Water, vector<string> ={"RainDance", "Liquidation"});
  26.     virtual ~Monster() {}
  27.     string get_name() const;
  28.     int get_level() const;
  29.     Type get_type() const;
  30.     const vector<string>& get_attacks() const;
  31.     friend ostream& operator<<(ostream& o,const Monster& h);
  32.     bool operator<(const Monster& f) const;
  33.     bool operator>(const Monster& f) const;
  34.     bool operator==(const Monster& f) const;
  35.     int operator+(int) const;
  36.     istream& read(istream&);
  37.     ostream& write(ostream&) const;
  38.     void baptize();
  39.     operator int() const {return level;}
  40. };
  41.  
  42. int operator+(int,const Monster&);
  43. int& operator+=(int&,const Monster&);
  44.  
  45.  
  46. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement