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.

50 lines
655 B

  1. #include "Point.h"
  2. Point::Point(uint32_t y, uint32_t x, int img)
  3. : x_ {x}, y_ {y}, img_ {img}
  4. { }
  5. void Point::setPoint(uint32_t y, uint32_t x) {
  6. x_ = x;
  7. y_ = y;
  8. }
  9. uint32_t Point::getX() const {
  10. return x_;
  11. }
  12. uint32_t Point::getY() const {
  13. return y_;
  14. }
  15. void Point::moveUp() {
  16. y_--;
  17. }
  18. void Point::moveDown() {
  19. y_++;
  20. }
  21. void Point::moveLeft() {
  22. x_--;
  23. }
  24. void Point::moveRight() {
  25. x_++;
  26. }
  27. int Point::getImg() const {
  28. return img_;
  29. }
  30. void Point::setImg(int image){
  31. img_ = image;
  32. }
  33. void Point::print() const {
  34. Graphics::get().printChar(y_, x_, img_);
  35. }
  36. void Point::clear() {
  37. img_ = ' ';
  38. print();
  39. }