本文整理汇总了C++中CCodeChain::DefineGlobal方法的典型用法代码示例。如果您正苦于以下问题:C++ CCodeChain::DefineGlobal方法的具体用法?C++ CCodeChain::DefineGlobal怎么用?C++ CCodeChain::DefineGlobal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCodeChain
的用法示例。
在下文中一共展示了CCodeChain::DefineGlobal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DefineGlobalWeaponType
void DefineGlobalWeaponType (CCodeChain &CC, const CString &sVar, CItemType *pWeaponType)
{
if (pWeaponType)
CC.DefineGlobalInteger(sVar, pWeaponType->GetUNID());
else
CC.DefineGlobal(sVar, CC.CreateNil());
}
示例2: DefineGlobalVector
void DefineGlobalVector (CCodeChain &CC, const CString &sVar, const CVector &vVector)
// DefineGlobalVector
//
// Defines a global variable and assigns it the given vector
{
ICCItem *pValue = CreateListFromVector(CC, vVector);
CC.DefineGlobal(sVar, pValue);
pValue->Discard(&CC);
}
示例3: DefineGlobalItem
void DefineGlobalItem (CCodeChain &CC, const CString &sVar, const CItem &Item)
// DefineGlobalItem
//
// Defines a global variable and assigns it the given item
{
ICCItem *pItem = CreateListFromItem(CC, Item);
CC.DefineGlobal(sVar, pItem);
pItem->Discard(&CC);
}
示例4: DefineGlobalSpaceObject
void DefineGlobalSpaceObject (CCodeChain &CC, const CString &sVar, CSpaceObject *pObj)
// DefineGlobalSpaceObject
//
// Defines a global variable and assigns it the given space object. If pObj
// is NULL then the variable is Nil.
{
if (pObj)
CC.DefineGlobalInteger(sVar, (int)pObj);
else
{
ICCItem *pValue = CC.CreateNil();
CC.DefineGlobal(sVar, pValue);
pValue->Discard(&CC);
}
}