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


C++ CItemData::GetName方法代码示例

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


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

示例1: UpdateAmendItem

void CUITrade::UpdateAmendItem( int nAmendIndex )
{
	if (m_pBaseAmendInfo == NULL)
		return;

	m_pBaseAmendInfo->Hide(TRUE);
	
	if (nAmendIndex < 0)
		return;

	stEventTrade* pTradeItem = CTradeItem::GetTradeItem(nAmendIndex);

	if (pTradeItem->result_itemIndex <= 0 || pTradeItem == NULL)
		return;
		
	m_pBaseAmendInfo->Hide(FALSE);
	
	CItemData* pItemData = _pNetwork->GetItemData(pTradeItem->result_itemIndex);

	if (pItemData == NULL)
		return;

	if (CUIIcon* pIcon = (CUIIcon*)m_pBaseAmendInfo->findUI("icon_amend_item"))
	{
		pIcon->setData(UBET_ITEM, pTradeItem->result_itemIndex);
	}

	if (CUITextBox* pTextBox = (CUITextBox*)m_pBaseAmendInfo->findUI("tb_amend_desc"))
	{
 		CTString strTmp = pItemData->GetDesc();
 
 		pTextBox->SetText(strTmp);
	}

	if (CUIText* pText = (CUIText*)m_pBaseAmendInfo->findUI("text_amend_name"))
	{
 		CTString strTmp = pItemData->GetName();
		
		strTmp = UtilHelp::getSingleton()->GetCalcStringEllipsis(strTmp, pText->GetWidth(), CTString("..."));

 		pText->SetText(strTmp);
	}

	UpdateAmendItemCount(nAmendIndex);
}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:45,代码来源:UITrade.cpp

示例2: ASSERT

int PWSfileV1V2::WriteRecord(const CItemData &item)
{
  ASSERT(m_fd != NULL);
  ASSERT(m_curversion != UNKNOWN_VERSION);
  int status = SUCCESS;

  switch (m_curversion) {
    case V17:
    {
      // 1.x programs totally ignore the type byte, hence safe to write it
      // (no need for two WriteCBC functions)
      // Note that 2.0 format still requires that the header be in this format,
      // So that old programs reading new databases won't crash,
      // This introduces a small security issue, in that the header is known text,
      // making the password susceptible to a dictionary attack on the first block,
      // rather than the hash^n in the beginning of the file.
      // we can help minimize this here by writing a random byte in the "type"
      // byte of the first block.

      StringX name = item.GetName();
      // If name field already exists - use it. This is for the 2.0 header, as well as for files
      // that were imported and re-exported.
      if (name.empty()) {
        // The name in 1.7 consists of title + SPLTCHR + username
        // DEFUSERNAME was used in previous versions, but 2.0 converts this upon import
        // so it is not an issue here.
        // Prepend 2.0 group field to name, if not empty
        // i.e. group "finances" name "broker" -> "finances.broker"
        StringX group = item.GetGroup();
        StringX title = item.GetTitle();
        if (!group.empty()) {
          group += _T(".");
          group += title;
          title = group;
        }
        name = title;
        name += SPLTCHR;
        name += item.GetUser();
      }
      unsigned char dummy_type;
      PWSrand::GetInstance()->GetRandomData(&dummy_type, 1);
      WriteCBC(dummy_type, name);
      WriteCBC(CItemData::PASSWORD, item.GetPassword());
      WriteCBC(CItemData::NOTES, ReMergeNotes(item));
      break;
    }
    case V20:
    {
      {
        uuid_array_t uuid_array;
        item.GetUUID(uuid_array);
        PWSfile::WriteCBC(CItemData::UUID, uuid_array, sizeof(uuid_array_t));
      }
      WriteCBC(CItemData::GROUP, item.GetGroup());
      WriteCBC(CItemData::TITLE, item.GetTitle());
      WriteCBC(CItemData::USER, item.GetUser());
      WriteCBC(CItemData::PASSWORD, item.GetPassword());
      WriteCBC(CItemData::NOTES, ReMergeNotes(item));
      WriteCBC(CItemData::END, _T(""));
      break;
    }
    default:
      ASSERT(0);
      status = UNSUPPORTED_VERSION;
  }
  return status;
}
开发者ID:macduff,项目名称:passwordsafe,代码行数:67,代码来源:PWSfileV1V2.cpp

示例3: CreateItem


//.........这里部分代码省略.........
			else if (f[2].second == 1) // axis y
			{
				rEnd.y = frandom(0.0f, 360.0f);
				rEnd.x = frandom(-15.0f, 15.0f);
				rEnd.z = 180.0f + frandom(-15.0f, 15.0f);
			}
			else // axis z
			{
				rEnd.y = 180.0f + frandom(-15.0f, 15.0f);
				rEnd.x = 0.0f+frandom(-15.0f, 15.0f);
				rEnd.z = frandom(0.0f, 360.0f);
			}
		}
		else
		{
			// 넓적
			// 땅의 노말의 영향을 받을 것
			if (f[0].second == 0)
			{
				// y,z = by normal
				pGroundItemInstance->qEnd = 
					RotationArc(
						D3DXVECTOR3(
						((float)(random()%2))*2-1+frandom(-0.1f,0.1f),
						0+frandom(-0.1f,0.1f),
						0+frandom(-0.1f,0.1f)),
						D3DXVECTOR3(0,0,1)/*normal*/);
			}
			else if (f[0].second == 1)
			{
				pGroundItemInstance->qEnd = 
					RotationArc(
						D3DXVECTOR3(
							0+frandom(-0.1f,0.1f),
							((float)(random()%2))*2-1+frandom(-0.1f,0.1f),
							0+frandom(-0.1f,0.1f)),
						D3DXVECTOR3(0,0,1)/*normal*/);
			}
			else 
			{
				pGroundItemInstance->qEnd = 
					RotationArc(
					D3DXVECTOR3(
					0+frandom(-0.1f,0.1f),
					0+frandom(-0.1f,0.1f),
					((float)(random()%2))*2-1+frandom(-0.1f,0.1f)),
					D3DXVECTOR3(0,0,1)/*normal*/);
			}
		}
		//D3DXQuaternionRotationYawPitchRoll(&pGroundItemInstance->qEnd, rEnd.y, rEnd.x, rEnd.z );
		float rot = frandom(0, 2*3.1415926535f);
		D3DXQUATERNION q(0,0,cosf(rot),sinf(rot));
		D3DXQuaternionMultiply(&pGroundItemInstance->qEnd, &pGroundItemInstance->qEnd, &q);
		q = RotationArc(D3DXVECTOR3(0,0,1),normal);
		D3DXQuaternionMultiply(&pGroundItemInstance->qEnd, &pGroundItemInstance->qEnd, &q);

		pGroundItemInstance->dwStartTime = CTimer::Instance().GetCurrentMillisecond();
		pGroundItemInstance->dwEndTime = pGroundItemInstance->dwStartTime+300;
		pGroundItemInstance->v3RotationAxis.x = sinf(rot+0);//frandom(0.4f,0.7f) * (2*(int)(random()%2) - 1);
		pGroundItemInstance->v3RotationAxis.y = cosf(rot+0);//frandom(0.4f,0.7f) * (2*(int)(random()%2) - 1);
		pGroundItemInstance->v3RotationAxis.z = 0;//frandom(0.4f,0.7f) * (2*(int)(random()%2) - 1);

		/*
		switch (no_rotation_axis)
		{
		case 0:
			pGroundItemInstance->rStart.x = 0;
			break;
		case 1:
			pGroundItemInstance->rStart.y = 0;
			break;
		case 2:
			pGroundItemInstance->rStart.z = 0;
			break;
		}*/

		D3DXVECTOR3 v3Adjust = -pGroundItemInstance->v3Center;
		D3DXMATRIX mat;
		D3DXMatrixRotationQuaternion(&mat, &pGroundItemInstance->qEnd);
		/*D3DXMatrixRotationYawPitchRoll(&mat, 
			D3DXToRadian(pGroundItemInstance->rEnd.y), 
			D3DXToRadian(pGroundItemInstance->rEnd.x), 
			D3DXToRadian(pGroundItemInstance->rEnd.z));*/

		D3DXVec3TransformCoord(&v3Adjust,&v3Adjust,&mat);
		//Tracef("%f %f %f\n",v3Adjust.x,v3Adjust.y,v3Adjust.z);
		//pGroundItemInstance->v3EndPosition += v3Adjust;
		//pGroundItemInstance->rEnd.z += pGroundItemInstance->v3Center.z;
	}

	pGroundItemInstance->ThingInstance.Show();

	m_GroundItemInstanceMap.insert(TGroundItemInstanceMap::value_type(dwVirtualID, pGroundItemInstance));

	CPythonTextTail& rkTextTail=CPythonTextTail::Instance();
	rkTextTail.RegisterItemTextTail(
		dwVirtualID,
		pItemData->GetName(),
		&pGroundItemInstance->ThingInstance);
}
开发者ID:adi97ida,项目名称:Client,代码行数:101,代码来源:PythonItem.cpp


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