本文整理汇总了C++中CCLinkedList::AppendInteger方法的典型用法代码示例。如果您正苦于以下问题:C++ CCLinkedList::AppendInteger方法的具体用法?C++ CCLinkedList::AppendInteger怎么用?C++ CCLinkedList::AppendInteger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCLinkedList
的用法示例。
在下文中一共展示了CCLinkedList::AppendInteger方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
ICCItem *CDeviceClass::GetItemProperty (CItemCtx &Ctx, const CString &sName)
// GetItemProperty
//
// Returns the item property. Subclasses should call this if they do not
// understand the property.
{
CCodeChain &CC = g_pUniverse->GetCC();
// Get the device
CInstalledDevice *pDevice = Ctx.GetDevice();
// Get the property
if (strEquals(sName, PROPERTY_CAN_BE_DISABLED))
return (pDevice ? CC.CreateBool(pDevice->CanBeDisabled(Ctx)) : CC.CreateBool(CanBeDisabled(Ctx)));
else if (strEquals(sName, PROPERTY_ENABLED))
return (pDevice ? CC.CreateBool(pDevice->IsEnabled()) : CC.CreateNil());
else if (strEquals(sName, PROPERTY_POS))
{
if (pDevice == NULL)
return CC.CreateNil();
// Create a list
ICCItem *pResult = CC.CreateLinkedList();
if (pResult->IsError())
return pResult;
CCLinkedList *pList = (CCLinkedList *)pResult;
// List contains angle, radius, and optional z
pList->AppendInteger(CC, pDevice->GetPosAngle());
pList->AppendInteger(CC, pDevice->GetPosRadius());
if (pDevice->GetPosZ() != 0)
pList->AppendInteger(CC, pDevice->GetPosZ());
// Done
return pResult;
}
else if (strEquals(sName, PROPERTY_SECONDARY))
return (pDevice ? CC.CreateBool(pDevice->IsSecondaryWeapon()) : CC.CreateNil());
else if (m_pItemType)
return CreateResultFromDataField(CC, m_pItemType->GetDataField(sName));
else
return CC.CreateNil();
}
示例2: if
ICCItem *CTopologyNode::GetProperty (const CString &sName)
// GetProperty
//
// Get topology node property
{
CCodeChain &CC = g_pUniverse->GetCC();
if (strEquals(sName, PROPERTY_LEVEL))
return CC.CreateInteger(GetLevel());
else if (strEquals(sName, PROPERTY_NAME))
return CC.CreateString(GetSystemName());
else if (strEquals(sName, PROPERTY_POS))
{
// If no map, then no position
if (m_pMap == NULL)
return CC.CreateNil();
// Create a list
ICCItem *pResult = CC.CreateLinkedList();
if (pResult->IsError())
return pResult;
CCLinkedList *pList = (CCLinkedList *)pResult;
pList->AppendInteger(CC, m_xPos);
pList->AppendInteger(CC, m_yPos);
return pResult;
}
else
return CC.CreateNil();
}