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


C++ LLSimInfo::insertLandForSaleAdult方法代码示例

本文整理汇总了C++中LLSimInfo::insertLandForSaleAdult方法的典型用法代码示例。如果您正苦于以下问题:C++ LLSimInfo::insertLandForSaleAdult方法的具体用法?C++ LLSimInfo::insertLandForSaleAdult怎么用?C++ LLSimInfo::insertLandForSaleAdult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LLSimInfo的用法示例。


在下文中一共展示了LLSimInfo::insertLandForSaleAdult方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: insertItem

// static public
// Insert an item in the relevant region map
// returns true if item inserted, false otherwise
bool LLWorldMap::insertItem(U32 x_world, U32 y_world, std::string& name, LLUUID& uuid, U32 type, S32 extra, S32 extra2)
{
	// Create an item record for the received object
	LLItemInfo new_item((F32)x_world, (F32)y_world, name, uuid);

	// Compute a region handle based on the objects coordinates
	LLVector3d	pos((F32)x_world, (F32)y_world, 40.0);
	U64 handle = to_region_handle(pos);

	// Get the region record for that handle or NULL if we haven't browsed it yet
	LLSimInfo* siminfo = LLWorldMap::getInstance()->simInfoFromHandle(handle);
	if (siminfo == NULL)
	{
		siminfo = LLWorldMap::getInstance()->createSimInfoFromHandle(handle);
	}

	//LL_INFOS("World Map") << "Process item : type = " << type << LL_ENDL;
	switch (type)
	{
		case MAP_ITEM_TELEHUB: // telehubs
		{
			/* Merov: we are not using the hub color anymore for display so commenting that out
			// Telehub color
			U32 X = x_world / REGION_WIDTH_UNITS;
			U32 Y = y_world / REGION_WIDTH_UNITS;
			F32 red = fmod((F32)X * 0.11f, 1.f) * 0.8f;
			F32 green = fmod((F32)Y * 0.11f, 1.f) * 0.8f;
			F32 blue = fmod(1.5f * (F32)(X + Y) * 0.11f, 1.f) * 0.8f;
			F32 add_amt = (X % 2) ? 0.15f : -0.15f;
			add_amt += (Y % 2) ? -0.15f : 0.15f;
			LLColor4 color(red + add_amt, green + add_amt, blue + add_amt);
			new_item.setColor(color);
			*/
			
			// extra2 specifies whether this is an infohub or a telehub.
			if (extra2)
			{
				siminfo->insertInfoHub(new_item);
			}
			else
			{
				siminfo->insertTeleHub(new_item);
			}
			break;
		}
		case MAP_ITEM_PG_EVENT: // events
		case MAP_ITEM_MATURE_EVENT:
		case MAP_ITEM_ADULT_EVENT:
		{
			struct tm* timep;
			// Convert to Pacific, based on server's opinion of whether
			// it's daylight savings time there.
			timep = utc_to_pacific_time(extra, gPacificDaylightTime);

			S32 display_hour = timep->tm_hour % 12;
			if (display_hour == 0) display_hour = 12;

			std::string tooltip = llformat( "%d:%02d %s",
										  display_hour,
										  timep->tm_min,
										  (timep->tm_hour < 12 ? "AM" : "PM") );
			new_item.setTooltip(tooltip);

			// HACK: store Z in extra2
			new_item.setElevation((F64)extra2);
			if (type == MAP_ITEM_PG_EVENT)
			{
				siminfo->insertPGEvent(new_item);
			}
			else if (type == MAP_ITEM_MATURE_EVENT)
			{
				siminfo->insertMatureEvent(new_item);
			}
			else if (type == MAP_ITEM_ADULT_EVENT)
			{
				siminfo->insertAdultEvent(new_item);
			}
			break;
		}
		case MAP_ITEM_LAND_FOR_SALE:		// land for sale
		case MAP_ITEM_LAND_FOR_SALE_ADULT:	// adult land for sale 
		{
			F32 cost_per_sqm = 0.0f;
			if (extra > 0)
			{
				cost_per_sqm = (F32)extra2 / (F32)extra;
			}
			std::string tooltip = llformat("%d sq.m. L$%d (L$ %.1f/sq.m.)", extra, extra2, cost_per_sqm);
			new_item.setTooltip(tooltip);
			if (type == MAP_ITEM_LAND_FOR_SALE)
			{
				siminfo->insertLandForSale(new_item);
			}
			else if (type == MAP_ITEM_LAND_FOR_SALE_ADULT)
			{
				siminfo->insertLandForSaleAdult(new_item);
			}
//.........这里部分代码省略.........
开发者ID:VirtualReality,项目名称:Viewer,代码行数:101,代码来源:llworldmap.cpp


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