Advertisement
patas99

Untitled

Jan 22nd, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.50 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. class prekazka
  6. {
  7. private:
  8.     string typ;
  9.     int x;
  10.     int y;
  11. public:
  12.     prekazka(int _x, int _y) : x(_x), y(_y) { ; }
  13. };
  14.  
  15. class lze_obejit :public prekazka
  16. {
  17. private:
  18.     string typ = "lze obejit";
  19.     int x;
  20.     int y;
  21. public:
  22.     lze_obejit(int _x, int _y) : prekazka(_x, _y) { ; }
  23. };
  24.  
  25. class lze_podlest : public prekazka
  26. {
  27. private:
  28.     string typ = "lze podlest";
  29.     int x;
  30.     int y;
  31. public:
  32.     lze_podlest(int _x, int _y) : prekazka(_x, _y) { ; }
  33. };
  34.  
  35. class lze_preskocit : public prekazka
  36. {
  37. private:
  38.     string typ = "lze preskocit";
  39.     int x;
  40.     int y;
  41. public:
  42.     lze_preskocit(int _x, int _y) : prekazka(_x, _y) { ; }
  43. };
  44. class panacek
  45. {
  46. private:
  47.     int nesmrtelnost;
  48.     string pohyb;
  49.     int x;
  50.     int y;
  51. public:
  52.     panacek(int _x,int _y) : x(_x),y(_y) { ; }
  53.     virtual void posun(int _x, int _y, string _pohyb)
  54.     {
  55.         this->x = _x;
  56.         this->y = _y;
  57.         this->pohyb = _pohyb;
  58.     }
  59. };
  60. class normalni : public panacek
  61. {
  62. private:
  63.     int nesmrtelnost = 0;
  64.     int x;
  65.     int y;
  66.     string pohyb;
  67. public:
  68.     normalni(int _x, int _y) : panacek(_x,_y) { ; }
  69.     void posun(int _x, int _y, string _pohyb)
  70.     {
  71.         this->x = _x;
  72.         this->y = _y;
  73.         this->pohyb = _pohyb;
  74.     }
  75. };
  76. class nesmrtelny : public panacek
  77. {
  78. private:
  79.     int nesmrtelnost = 1;
  80.     int x;
  81.     int y;
  82.     string pohyb;
  83. public:
  84.     nesmrtelny(int _x, int _y) : panacek(_x, _y) { ; }
  85.     void posun(int _x, int _y, string _pohyb)
  86.     {
  87.         this->x = _x;
  88.         this->y = _y;
  89.         this->pohyb = _pohyb;
  90.     }
  91. };
  92.  
  93. int main(void)
  94. {
  95.    
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement