| 5 | { |
| 6 | template<typename _T, int __Scale> |
| 7 | bool Point<_T,__Scale>::isValid() const |
| 8 | { |
| 9 | // Not valid if < 0 |
| 10 | if ( this->x < 0 || this->y < 0 ) |
| 11 | return false; |
| 12 | |
| 13 | // If Broodwar pointer is not initialized, just assume maximum map size |
| 14 | if ( !BroodwarPtr ) |
| 15 | return this->x < (256 * 32)/__Scale && |
| 16 | this->y < (256 * 32)/__Scale; |
| 17 | |
| 18 | // If BW ptr exists then compare with actual map size |
| 19 | return this->x < (Broodwar->mapWidth() * 32)/__Scale && |
| 20 | this->y < (Broodwar->mapHeight() * 32)/__Scale; |
| 21 | } |
| 22 | |
| 23 | template<typename _T, int __Scale> |
| 24 | Point<_T,__Scale> &Point<_T,__Scale>::makeValid() |