bool covers(int x, int y) const
{
- return x >= pos.x_ && x < pos.x_ + dim.wid
- && y >= pos.y_ - dim.asc && y <= pos.y_ + dim.des;
+ return x >= pos.x_
+ && x <= pos.x_ + dim.wid
+ && y >= pos.y_ - dim.asc
+ && y <= pos.y_ + dim.des;
}
int squareDistance(int x, int y) const
Geometry & geometry(T const * thing)
{
- check(thing, "geometry");
+ checkDim(thing, "geometry");
return data_.find(thing)->second;
}
Geometry const & geometry(T const * thing) const
{
- check(thing, "geometry");
+ checkDim(thing, "geometry");
return data_.find(thing)->second;
}