You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

39 lines
700 B

  1. #pragma once
  2. class Object {
  3. public:
  4. struct Position {
  5. double X, Y;
  6. Position(): X(0), Y(0) {
  7. }
  8. Position(double x, double y): X(x), Y(y) {
  9. }
  10. void setPos(double x, double y) {
  11. X = x, Y = y;
  12. }
  13. const Position& operator=(const Position &p) {
  14. this->X = p.X, this->Y = p.Y;
  15. return *this;
  16. }
  17. };
  18. Object();
  19. Object(Position pos, int size, char symbol);
  20. virtual char getSymbol();
  21. Position getPosition();
  22. int getSize();
  23. void setPosition(Position p);
  24. void changePosition(double dx, double dy);
  25. protected:
  26. char m_symbol;
  27. int m_size;
  28. Position m_pos;
  29. };