Advertisement
Guest User

sadasdzsdsa

a guest
Jun 18th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.35 KB | None | 0 0
  1. class Osoba
  2. {
  3.   protected:
  4.         string Stan;
  5.         int Zycie;
  6.         string typ;
  7.         int AtakFizBase;
  8.         int BlokBase;
  9.         int AktualneZycie;
  10. public:
  11.     Osoba(){ Stan ="Żywy"; }
  12.     Osoba(int zycie){Zycie=zycie; AktualneZycie=zycie; }
  13.     virtual ~Osoba(){}
  14.    
  15. }
  16.  
  17. class Czlowiek:public Osoba
  18. {
  19.     protected:
  20.         int Mana;
  21.         int AtackMagBase;
  22.     public:
  23.         Czlowiek ()
  24.         {
  25.             //tu wywołaj konstruktor z klasy Osoba z parametrem zycie ()
  26.         }
  27.         Czlowiek(int mana, int AMB){
  28.             //tu wywołaj konstruktor z klasy Osoba z parametrem zycie ()
  29.             Mana=mana; AtackMagBase = AMB;
  30.            
  31.         }
  32.         int get_mana() const {return this->Mana;}
  33.         int get_AtackMagBase() const {return this->AtackMagBase;}
  34.         void set_mana(int value, char sign) const {
  35.             if (sign == "-")
  36.                 this->Mana -= value;
  37.             else
  38.                 this->Mana += value;
  39.         virtual int AtakMagi (){}; //??? po co to w sumie ?
  40. };
  41. class Mag:public Czlowiek
  42. {
  43.     public:
  44.         Mag ()
  45.         {
  46.             //tu wywołaj konstruktor człowieka z parametrami mana i atakcośtamcośtam
  47.         };
  48.         virtual int AtakMagi ()
  49.         {
  50.             if(get_mana()>9)
  51.                 set_mana(10,'-');
  52.             return get_AtackMagBase();
  53.         };
  54.  
  55. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement