Advertisement
Guest User

3 i 4

a guest
Oct 23rd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #pragma once
  2. #include "safari.h"
  3. #include <iostream>
  4. #include "vectors.h"
  5. class Animal{
  6. protected:
  7. Vector2D pos;
  8. Vector2D direction;
  9. float velocity;
  10. public:
  11. Animal(const Vector2D& pos,const Vector2D& direction, float velocity):pos(pos), direction(direction),velocity(velocity){this->direction.normalize();}
  12. virtual void Show(){
  13. std::cout<<"pozycja ";
  14. pos.Show();
  15. std::cout<<"kierunek ";
  16. direction.Show();
  17. std::cout<<"predkosc "<<velocity<<std::endl;
  18. }
  19.  
  20. void Run(){
  21. pos += (direction*velocity);
  22. }
  23.  
  24. virtual void Do(Safari& safari)=0;
  25.  
  26. const Vector2D& GetPos()const {return pos;}
  27.  
  28. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement