18 lines
600 B
C++
18 lines
600 B
C++
|
#include "CMap.h"
|
||
|
|
||
|
namespace { auto & map = BWEM::Map::Instance(); }
|
||
|
|
||
|
// gets the TilePosition of the center of an area
|
||
|
TilePosition CMap::getAreaAverage(const BWEM::Area* area)
|
||
|
{
|
||
|
int xAverage = (area->TopLeft().x + area->BottomRight().x) / 2;
|
||
|
int yAverage = (area->TopLeft().y + area->BottomRight().y) / 2;
|
||
|
return TilePosition(xAverage, yAverage);
|
||
|
}
|
||
|
|
||
|
TilePosition CMap::getAreaAverage(const BWEM::Area area)
|
||
|
{
|
||
|
int xAverage = (area.TopLeft().x + area.BottomRight().x) / 2;
|
||
|
int yAverage = (area.TopLeft().y + area.BottomRight().y) / 2;
|
||
|
return TilePosition(xAverage, yAverage);
|
||
|
}
|