当前位置: 首页>>代码示例>>C++>>正文


C++ AreaStore::getAreasInArea方法代码示例

本文整理汇总了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; // */
}
开发者ID:Caellian,项目名称:minetest,代码行数:20,代码来源:areastore.cpp

示例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;
}
开发者ID:BlockMen,项目名称:minetest,代码行数:25,代码来源:l_areastore.cpp


注:本文中的AreaStore::getAreasInArea方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。