Handy class to describe a position.It is just a point, with a set of methods that makes it useful. More...
#include <Position.hh>
Public Member Functions | |
| Position (int row, int col) | |
| Position (const Point &pos) | |
| int | getRow () const |
| int | getCol () const |
| void | setRow (int row) |
| void | setCol (int col) |
| int | getX () const |
| int | getY () const |
| void | setX (int x) |
| void | setY (int y) |
| bool | isNear (const Position &from, int dist=1) const |
| Check if another point is in the neighbourhood. | |
| float | distance (const Position &to) const |
| Return the distance between the two point. | |
| Position & | operator+= (const Position &rhs) |
Public Attributes | |
| int | row |
| Row position. | |
| int | col |
| Column position. | |
Friends | |
| bool | operator== (const Position &lhs, const Position &rhs) |
| bool | operator!= (const Position &lhs, const Position &rhs) |
| Position | operator+ (const Position &lhs, const Position &rhs) |
| Position | operator- (const Position &lhs, const Position &rhs) |
| Position | operator* (int factor, const Position &rhs) |
| std::ostream & | operator<< (std::ostream &os, const Position &p) |
Handy class to describe a position.
It is just a point, with a set of methods that makes it useful.
| bool Position::isNear | ( | const Position & | from, | |
| int | dist = 1 | |||
| ) | const [inline] |
1.6.3