本文整理汇总了C++中PyList::IsList方法的典型用法代码示例。如果您正苦于以下问题:C++ PyList::IsList方法的具体用法?C++ PyList::IsList怎么用?C++ PyList::IsList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyList
的用法示例。
在下文中一共展示了PyList::IsList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Handle_CreateContract
//.........这里部分代码省略.........
if( call.byname.find( "itemList" ) != call.byname.end() )
{
itemList = call.byname.find( "itemList" )->second->AsList();
}
if( info.endStationID == 0 )info.endStationID = info.startStationID;
ContractData* cData = new ContractData(
call.client->GetCharacterID(),
call.client->GetCorporationID(),
info.type,
info.avail,
info.assigneeID,
info.expiretime,
info.expiretime,
info.startStationID,
info.endStationID,
call.client->GetSystemID(),
call.client->GetSystemID(),
call.client->GetRegionID(),
call.client->GetRegionID(),
info.price,
info.reward,
info.collateral,
info.title,
info.description,
forCorp,
conStatusOutstanding,
false,
0,
Win32TimeNow(),
Win32TimeNow() + ( info.duration * Win32Time_Day ),
Win32TimeNow(),
Win32TimeNow(),
0,
false,
0,
0,
0
);
std::map<uint32, ContractRequestItemRef> requestItems;
std::map<uint32, ContractGetItemsRef> items;
uint32 itemID = 0;
uint32 typeID = 0;
for( size_t i = 0; i < itemList->size(); i ++ )
{
if( itemList->IsList() )
{
if( itemList->GetItem( i )->AsList()->GetItem( 0 )->IsInt() )
itemID = itemList->GetItem( i )->AsList()->GetItem( 0 )->AsInt()->value();
else{
sLog.Error( "ContractMgrService", "Wrong list args" );
break;
}
}
InventoryItemRef item = m_manager->item_factory.GetItem( itemID );
if( item == NULL )
{
sLog.Error( "ContractMgrService", "GetItem returned NULL" );
break;
}
item->Move( call.client->GetStationID(), flagBriefcase, true );
item->ChangeOwner( 1, true );
items.insert( std::make_pair( itemID, ContractGetItemsRef( new ContractGetItems( itemID, itemList->GetItem( i )->AsList()->GetItem( 1 )->AsInt()->value() ) ) ) );
}
if( cData->m_type == conTypeItemExchange )
{
for( size_t i = 0; i < requestItemTypeList->size(); i ++ )
{
if( itemList->IsList() )
{
if( requestItemTypeList->GetItem( i )->AsList()->GetItem( 0 )->IsInt() )
typeID = requestItemTypeList->GetItem( i )->AsList()->GetItem( 0 )->AsInt()->value();
else{
sLog.Error( "ContractMgrService", "Wrong list args" );
break;
}
}
requestItems.insert( std::make_pair( itemID, ContractRequestItemRef( new ContractRequestItem(itemID, requestItemTypeList->GetItem( i )->AsList()->GetItem( 1 )->AsInt()->value() ) ) ) );
}
}
uint32 contractID = 0;
sLog.Debug( "ContractMgrService", "Creating contract..." );
ContractRef _contract = ContractRef( new Contract( contractID, *cData, requestItems, items, m_manager->item_factory, *m_contractManager ) );
contractID = m_contractManager->CreateContract( _contract );
sLog.Debug( "ContractMgrService", "Contract created" );
return new PyInt( contractID );
}