20 lines
417 B
C++
20 lines
417 B
C++
//Position.hpp
|
|
#pragma once
|
|
#include <iostream>
|
|
|
|
class Position {
|
|
private:
|
|
int _x;
|
|
int _y;
|
|
public:
|
|
Position() : _x(0), _y(0) {}
|
|
~Position() {}
|
|
Position(int x, int y) : _x(x), _y(y) {}
|
|
int getX() const { return _x; }
|
|
int getY() const { return _y; }
|
|
friend std::ostream& operator<<(std::ostream& os, const Position& pos) {
|
|
os << "Position(" << pos._x << ", " << pos._y << ")";
|
|
return os;
|
|
}
|
|
};
|