本文整理汇总了C++中AreaStore::getAreasInArea方法的典型用法代码示例。如果您正苦于以下问题:C++ AreaStore::getAreasInArea方法的具体用法?C++ AreaStore::getAreasInArea怎么用?C++ AreaStore::getAreasInArea使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AreaStore
的用法示例。
在下文中一共展示了AreaStore::getAreasInArea方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cacheMiss
void AreaStore::cacheMiss(void *data, const v3s16 &mpos, std::vector<Area *> *dest)
{
AreaStore *as = (AreaStore *)data;
u8 r = as->m_cacheblock_radius;
// get the points at the edges of the mapblock
v3s16 minedge(mpos.X * r, mpos.Y * r, mpos.Z * r);
v3s16 maxedge(
minedge.X + r - 1,
minedge.Y + r - 1,
minedge.Z + r - 1);
as->getAreasInArea(dest, minedge, maxedge, true);
/* infostream << "Cache miss with " << dest->size() << " areas, between ("
<< minedge.X << ", " << minedge.Y << ", " << minedge.Z
<< ") and ("
<< maxedge.X << ", " << maxedge.Y << ", " << maxedge.Z
<< ")" << std::endl; // */
}
示例2: l_get_areas_in_area
// get_areas_in_area(edge1, edge2, accept_overlap, include_borders, include_data)
int LuaAreaStore::l_get_areas_in_area(lua_State *L)
{
NO_MAP_LOCK_REQUIRED;
LuaAreaStore *o = checkobject(L, 1);
AreaStore *ast = o->as;
v3s16 minedge = check_v3s16(L, 2);
v3s16 maxedge = check_v3s16(L, 3);
bool include_borders = true;
bool include_data = false;
bool accept_overlap = false;
if (lua_isboolean(L, 4)) {
accept_overlap = lua_toboolean(L, 4);
get_data_and_border_flags(L, 5, &include_borders, &include_data);
}
std::vector<Area *> res;
ast->getAreasInArea(&res, minedge, maxedge, accept_overlap);
push_areas(L, res, include_borders, include_data);
return 1;
}