本文整理汇总了C++中Item函数的典型用法代码示例。如果您正苦于以下问题:C++ Item函数的具体用法?C++ Item怎么用?C++ Item使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Item函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: found
Project::Item Project::Item::findItemForFile (const File& file) const
{
if (getFile() == file)
return *this;
if (isGroup())
{
for (int i = getNumChildren(); --i >= 0;)
{
Item found (getChild(i).findItemForFile (file));
if (found.isValid())
return found;
}
}
return Item (project, ValueTree::invalid);
}
开发者ID:Labmind,项目名称:GUI,代码行数:18,代码来源:jucer_Project.cpp
示例2: while
QList<JabberSearchManager::Item> JabberSearchManager::FromStandardItems (const QDomElement& items)
{
QList<Item> result;
QDomElement item = items.firstChildElement ("item");
while (!item.isNull ())
{
result << Item (item.attribute ("jid"),
item.firstChildElement ("first").text (),
item.firstChildElement ("last").text (),
item.firstChildElement ("nick").text (),
item.firstChildElement ("email").text ());
item = item.nextSiblingElement ("item");
}
return result;
}
开发者ID:Kalarel,项目名称:leechcraft,代码行数:18,代码来源:jabbersearchmanager.cpp
示例3: if
void XmlToQtScript::FilterQtInternalsPostProcessor::process(Item* iterator, QList<Item>* in)
{
if(m_internalClasses.contains(iterator->targetClass))
{
// qDebug() << Q_FUNC_INFO << "Skipping" << iterator->target << iterator->targetClass << iterator->method << iterator->parameters;
*iterator = Item();
if(in->first().method == "msec")
{
in->takeFirst();
}
}
/*
else if(!iterator->target.isNull())
{
qDebug() << Q_FUNC_INFO << "Keeping" << iterator->target << iterator->targetClass;
}
*/
}
开发者ID:Vadim-Stupakov,项目名称:hooq,代码行数:18,代码来源:XmlToQtScript_FilterQtInternalsPostProcessor.cpp
示例4: found
Project::Item Project::Item::findItemWithID (const String& targetId) const
{
if (state [Ids::ID] == targetId)
return *this;
if (isGroup())
{
for (int i = getNumChildren(); --i >= 0;)
{
Item found (getChild(i).findItemWithID (targetId));
if (found.isValid())
return found;
}
}
return Item (project, ValueTree(), false);
}
开发者ID:kokoar,项目名称:JUCE,代码行数:18,代码来源:jucer_Project.cpp
示例5: luCameraObjPropsRefFromVariant
void luCameraObjProperty::RefreshChildren()
{
if ( !GetChildCount() ) return;
const luCameraObjProps& obj = luCameraObjPropsRefFromVariant(m_value);
Item(PROP_CLIPSTART)->SetValue(double(obj.props.m_clipstart));
Item(PROP_CLIPEND)->SetValue(double(obj.props.m_clipend));
Item(PROP_FOV)->SetValue(double(obj.props.m_fov));
Item(PROP_ORTHOSCALE)->SetValue(double(obj.props.m_orthoscale));
Item(PROP_START)->SetValue(obj.props.m_start);
Item(PROP_TYPE)->SetValue(obj.props.m_type);
}
开发者ID:Ali-il,项目名称:gamekit,代码行数:13,代码来源:luProps.cpp
示例6: Item
BSTR cADOCE::Name(long Col)
{
//////////////////////////////////////////////////////////////
// Return the Name of a Field
//////////////////////////////////////////////////////////////
BSTR bstrData;
IADOCEField* TargetField;
// Get the Field.
TargetField = Item(Col);
if(TargetField)
hr = TargetField->get_Name(&bstrData);
// Return the NAME of the field
return bstrData;
}
开发者ID:pfeilbr,项目名称:repo,代码行数:19,代码来源:cadoce.cpp
示例7: normalized_path
void
RelinkingModel::addPath(RelinkablePath const& path)
{
QString const normalized_path(path.normalizedPath());
std::pair<std::set<QString>::iterator, bool> const ins(
m_origPathSet.insert(path.normalizedPath())
);
if (!ins.second) {
// Not inserted because identical path is already there.
return;
}
beginInsertRows(QModelIndex(), m_items.size(), m_items.size());
m_items.push_back(Item(path));
endInsertRows();
requestStatusUpdate(index(m_items.size() - 1));
}
开发者ID:DevangThakkar,项目名称:scantailor,代码行数:19,代码来源:RelinkingModel.cpp
示例8: GetNoUsedID
unsigned int CRsltVariable::GetNoUsedID()
{
int count=Count();
for(unsigned int ii=1;ii<1000;ii++)
{
bool bNoUse=true;
for(int jj=0;jj<count;jj++)
{
if(Item(jj)->GetID()==ii)
{
bNoUse=false;
break;
}
}
if(bNoUse)
return ii;
}
return 0;
}
开发者ID:adoggie,项目名称:algorithm_package,代码行数:19,代码来源:Result.cpp
示例9: update
void GridWindow::update(const std::vector<Item>& items)
{
unsigned int x,y;
x=y=0;
items_in_grid.clear();
for(auto it : items)
{
grid.appendItem(x,y,it.gid, 0);
grid.appendItem(x,y,710,1);
items_in_grid.push_back(Item(x,y,it.gid, it.id));
if(x < grid.getSize().x)
++x;
if(x == grid.getSize().x)
{
x=0;
++y;
}
}
}
开发者ID:xim3,项目名称:sfml-wrapper,代码行数:19,代码来源:GridWindow.cpp
示例10: Item
void cPlayer::FinishEating(void)
{
// Reset the timer:
m_EatingFinishTick = -1;
// Send the packets:
m_ClientHandle->SendEntityStatus(*this, esPlayerEatingAccepted);
m_World->BroadcastEntityMetadata(*this);
// consume the item:
cItem Item(GetEquippedItem());
Item.m_ItemCount = 1;
cItemHandler * ItemHandler = cItemHandler::GetItemHandler(Item.m_ItemType);
if (!ItemHandler->EatItem(this, &Item))
{
return;
}
ItemHandler->OnFoodEaten(m_World, this, &Item);
}
开发者ID:cedeel,项目名称:MCServer,代码行数:19,代码来源:Player.cpp
示例11: expand_symbol_into_itemset
void Parser::expand_symbol_into_itemset(ItemSet* is, std::string symbol, std::set<std::string>* encountered_terminals) {
if (Parser::symbol_is_token(symbol)) {
std::cout << "=== expand symbol into itemset: token " << symbol << std::endl;
return;
} else {
// if new symbol was inserted
if (encountered_terminals->insert(symbol).second) {
std::cout << "=== expand symbol into itemset: new nonterminal " << symbol << std::endl;
for (Production* p : this->nonterminals.at(symbol)) {
std::cout << "\t";
Parser::debug_production(p);
is->additionals.insert(Item(p, 0));
this->expand_symbol_into_itemset(is, p->symbols.front(), encountered_terminals);
}
} else {
std::cout << "=== expand symbol into itemset: existing nonterminal " << symbol << std::endl;
}
}
}
开发者ID:Raekye,项目名称:hmmm,代码行数:19,代码来源:parser.cpp
示例12: sswitch
bool CPageAntispamSink::OnClicked(CItemBase* pItem)
{
FolderInfo_t * pFolder = NULL;
sswitch(pItem->m_strItemId.c_str())
scase("CS_Browse") pFolder = &m_ser->CertainSpamRule.FolderForAction; sbreak;
scase("PS_Browse") pFolder = &m_ser->PossibleSpamRule.FolderForAction; sbreak;
scase("Link") _Module.ShowAntiSpamSettings(); sbreak
send
if( pFolder )
{
UpdateData(false);
if(CBrowseForFolder(m_arrLocalFolders, pFolder, m_hTreeImageList).DoModal(Item(), "OutlookPlugun.Antispam.Browse") == DLG_ACTION_OK)
{
UpdateData(true);
}
}
return TBaseDlg::OnClicked(pItem);
}
开发者ID:hackshields,项目名称:antivirus,代码行数:20,代码来源:SettingsDlg.cpp
示例13: evictOldItems
void ParserContext::msgReady(uint64_t id, McMsgRef msg) {
TimePoint now = Clock::now();
evictOldItems(now);
std::string invKey;
if (id != 0) {
auto pairMsgIt = msgs_.find(id);
if (pairMsgIt != msgs_.end()) {
invKey = std::move(pairMsgIt->second.key);
msgs_.erase(pairMsgIt->first);
}
if (msg->key.len > 0) {
auto msgIt = msgs_.emplace(
id,
Item(id, to<std::string>(msg->key), now));
evictionQueue_.push_back(msgIt.first->second);
}
}
callback_(id, std::move(msg), std::move(invKey), fromAddress_, toAddress_);
}
开发者ID:tidaybreak,项目名称:mcrouter,代码行数:20,代码来源:ParserMap.cpp
示例14: Count
STDMETHODIMP CompositeOverlayImpl<B>::get_Overlays(LPSAFEARRAY *pVal)
{
short count;
Count(&count);
SAFEARRAY *pArray = ::SafeArrayCreateVector(VT_DISPATCH, 0, count);
IOverlay *pOverlay;
long indices[1];
for (int i=0; i<count; i++)
{
indices[0] = i;
Item(CComVariant(i), &pOverlay);
::SafeArrayPutElement(pArray, indices, pOverlay);
pOverlay->Release();
}
*pVal = pArray;
return S_OK;
}
开发者ID:Templier,项目名称:desktopx,代码行数:20,代码来源:CompositeOverlayImpl.cpp
示例15: Close
void CProcMonSniffDlg::OnEvent(tDWORD nEventId, cSerializable * pData)
{
if( nEventId == cCalcSecurityRatingProgress::eIID && pData && pData->isBasedOn(cCalcSecurityRatingProgress::eIID) )
{
cCalcSecurityRatingProgress *srp = (cCalcSecurityRatingProgress *)pData;
if( srp->m_nActionId == cCalcSecurityRatingProgress::eCloseNotification )
{
Close();
return;
}
if( m_info.m_nPID == srp->m_nPID )
{
m_info = *srp;
Item()->UpdateData(true);
return;
}
return;
}
CDialogSink::OnEvent(nEventId, pData);
}
开发者ID:hackshields,项目名称:antivirus,代码行数:20,代码来源:AlertDialog.cpp
示例16: switch
void Furnace::consumeFuel()
{
// Check that we have fuel
if(slots()[SLOT_FUEL].count == 0)
return;
// Increment the fuel burning time based on fuel type
// http://www.minecraftwiki.net/wiki/Furnace#Fuel_efficiency
Item *fuelSlot = &slots()[SLOT_FUEL];
uint16_t fuelTime = 0;
switch(fuelSlot->type)
{
case ITEM_COAL: fuelTime = 80; break;
case BLOCK_PLANK: fuelTime = 15; break;
case ITEM_STICK: fuelTime = 5; break;
case BLOCK_WOOD: fuelTime = 15; break;
case BLOCK_WORKBENCH: fuelTime = 15; break;
case BLOCK_CHEST: fuelTime = 15; break;
case BLOCK_BOOKSHELF: fuelTime = 15; break;
case BLOCK_JUKEBOX: fuelTime = 15; break;
case BLOCK_FENCE: fuelTime = 15; break;
case BLOCK_WOODEN_STAIRS: fuelTime = 15; break;
case ITEM_LAVA_BUCKET: fuelTime = 1000; break;
default: break;
}
if(fuelTime > 0)
{
data->burnTime += fuelTime;
// Now decrement the fuel & reset
fuelSlot->count--;
if (fuelSlot->count == 0)
{
*fuelSlot = Item();
}
}
// Update our block type if need be
updateBlock();
}
开发者ID:nathacof,项目名称:mineserver,代码行数:41,代码来源:furnace.cpp
示例17: getline
void Game::doFill() {
if (object != verb)
{
Item toFill = player->getItem(object);
if (toFill.first != "NOITEM")
{
if (checkAction(toFill, FILL))
{
cout << "What do you want to fill the " << object << " with?" << endl;
cout << ">";
getline(cin, object);
Item result = room_list[current_room]->getItem(object);
if (checkAction(result, FILL))
{
room_list[current_room]->changeState(toFill.first);
cout << "You filled the " << toFill.first << " with " << object << endl;
if (toFill.first.compare("bottle") == 0)
{
player->removeItem("bottle");
player->pickItem(Item("water", { PUT }));
}
}
else
{
cout << "You can't fill the " << toFill.first << " with a " << object << endl;
return;
}
}
else cout << "You can't fill a " << toFill.first << endl;
}
else cout << "You don't have a " << object << endl;
}
else {
cout << "What do you want to fill?" << endl;
cout << ">";
getline(cin, object);
doFill();
}
}
开发者ID:DavidRVi,项目名称:MyZork,代码行数:41,代码来源:game.cpp
示例18: reset
bool Texture::load( const std::string& filaname )
{
Ref ref; // Reference to the Item we'll be working on.
// We only need to reset if we're referencing a texture.
if( key.size() ) {
reset();
}
key = filaname;
ref = get_ref();
// If this Item already exists, and is loaded, we're all set.
if( ref != -1u && ref < registery.size() && registery[ref].refCount++ != 0 )
return true;
// Otherwise, make it.
registery.push_back( Item(key,0,1) );
ref = registery.size() - 1;
glGenTextures( 1, ®istery[ref].glHandle );
// Use SDL to lead the image for simplicity.
SDL_Surface* sdlSurface = SDL_LoadBMP( filaname.c_str() );
if( sdlSurface )
{
gen_texture( registery[ref].glHandle, sdlSurface );
SDL_FreeSurface( sdlSurface );
ok = true;
}
else
{
ok = false;
}
return ok;
}
开发者ID:splinterofchaos,项目名称:Gravity-Battle,代码行数:41,代码来源:Texture.cpp
示例19: smelt
void Furnace::smelt()
{
// Check if we're cooking
if (isCooking())
{
// Convert where applicable
Item* inputSlot = &slots()[SLOT_INPUT];
Item* fuelSlot = &slots()[SLOT_FUEL];
Item* outputSlot = &slots()[SLOT_OUTPUT];
int32_t creationID = createList[inputSlot->getType()].output;
// Update other params if we actually converted
if (creationID != -1 && outputSlot->getCount() != 64)
{
// Check if the outputSlot is empty
if (outputSlot->getType() == -1)
{
outputSlot->setType(creationID);
outputSlot->setCount(1);
outputSlot->setHealth(createList[inputSlot->getType()].meta);
inputSlot->setCount(inputSlot->getCount() - 1);
m_data->cookTime = 0;
}
// Ok - now check if the current output slot contains the same stuff
if (outputSlot->getType() == creationID && m_data->cookTime != 0)
{
// Increment output and decrememnt the input source
outputSlot->setCount(outputSlot->getCount() + createList[inputSlot->getType()].count);
inputSlot->setCount(inputSlot->getCount() - 1);
outputSlot->setHealth(createList[inputSlot->getType()].meta);
m_data->cookTime = 0;
if (inputSlot->getCount() == 0)
{
*inputSlot = Item();
}
}
}
}
}
开发者ID:ONWT,项目名称:mineserver,代码行数:41,代码来源:furnace.cpp
示例20: Menu
// マップでのメニューを担当する(ここの返り値が0ならメニューが表示されていない1なら表示されている。)
// ここを最初に読み込むMainMenu()が先じゃないぞ
int Menu( Character_t *Character, Map_t Map, int *FieldNumber ){
if(CheckHitKey2( KEY_INPUT_C )==1)if(MapMenu[0].Flag==0)MapMenu[0].Flag=1;
if( MapMenu[0].Flag==1 )MainMenu(); // メニューが開いた時の処理,ここで選択
if( MapMenu[1].Flag==1 )Search(); // 調べるの動作
if( MapMenu[2].Flag==1 )Item(); // アイテムの動作
if( MapMenu[3].Flag==1 )Magic( Map, FieldNumber); // 呪文の動作
if( MapMenu[4].Flag==1 )StatusMenu( Character ); // ステータス画面の描画
//削除の処理はここ
if( CheckHitKey2( KEY_INPUT_X )== 1 && MapMenu[1].Flag!=1 )for( int i=0;i<5;i++)MapMenu[i].Flag=0;
//メニューが表示されているときは勇者を動かさないということ
//なぜMapMenu[0]だけかというとこれがトップ画面なのでずっと出っ放し。
//必ずメニューを描画しているときはこのフラグは1
if(MapMenu[0].Flag==1)return 1;
return 0;
}
开发者ID:ykprogram,项目名称:New-RPG,代码行数:23,代码来源:MapMenu.cpp
注:本文中的Item函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论