mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
30 lines
425 B
C++
30 lines
425 B
C++
/** @file
|
|
*
|
|
* @par History
|
|
*/
|
|
|
|
|
|
#include "boundbox.h"
|
|
|
|
namespace Pol
|
|
{
|
|
namespace Mobile
|
|
{
|
|
bool BoundingBox::contains( const Core::Pos2d& pos ) const
|
|
{
|
|
for ( const auto& elem : areas )
|
|
{
|
|
if ( pos >= elem.topleft && pos <= elem.bottomright )
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
void BoundingBox::addarea( const Area& area )
|
|
{
|
|
areas.push_back( area );
|
|
}
|
|
} // namespace Mobile
|
|
} // namespace Pol
|