Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- class prekazka
- {
- private:
- string typ;
- int x;
- int y;
- public:
- prekazka(int _x, int _y) : x(_x), y(_y) { ; }
- };
- class lze_obejit :public prekazka
- {
- private:
- string typ = "lze obejit";
- int x;
- int y;
- public:
- lze_obejit(int _x, int _y) : prekazka(_x, _y) { ; }
- };
- class lze_podlest : public prekazka
- {
- private:
- string typ = "lze podlest";
- int x;
- int y;
- public:
- lze_podlest(int _x, int _y) : prekazka(_x, _y) { ; }
- };
- class lze_preskocit : public prekazka
- {
- private:
- string typ = "lze preskocit";
- int x;
- int y;
- public:
- lze_preskocit(int _x, int _y) : prekazka(_x, _y) { ; }
- };
- class panacek
- {
- private:
- int nesmrtelnost;
- string pohyb;
- int x;
- int y;
- public:
- panacek(int _x,int _y) : x(_x),y(_y) { ; }
- virtual void posun(int _x, int _y, string _pohyb)
- {
- this->x = _x;
- this->y = _y;
- this->pohyb = _pohyb;
- }
- };
- class normalni : public panacek
- {
- private:
- int nesmrtelnost = 0;
- int x;
- int y;
- string pohyb;
- public:
- normalni(int _x, int _y) : panacek(_x,_y) { ; }
- void posun(int _x, int _y, string _pohyb)
- {
- this->x = _x;
- this->y = _y;
- this->pohyb = _pohyb;
- }
- };
- class nesmrtelny : public panacek
- {
- private:
- int nesmrtelnost = 1;
- int x;
- int y;
- string pohyb;
- public:
- nesmrtelny(int _x, int _y) : panacek(_x, _y) { ; }
- void posun(int _x, int _y, string _pohyb)
- {
- this->x = _x;
- this->y = _y;
- this->pohyb = _pohyb;
- }
- };
- int main(void)
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement