本文整理汇总了C++中MenuItem::addTableImage方法的典型用法代码示例。如果您正苦于以下问题:C++ MenuItem::addTableImage方法的具体用法?C++ MenuItem::addTableImage怎么用?C++ MenuItem::addTableImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MenuItem
的用法示例。
在下文中一共展示了MenuItem::addTableImage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: resetTableImages
void FranchiseHq::resetTableImages(std::vector<TableImage*>& tableImages) {
for (std::vector<TableImage*>::iterator t=tableImages.begin(); t != tableImages.end(); t++)
{
MenuItem* m = findMenuItemIndexed( (*t)->getIndexOfAssignedMenuItem() );
if ( m == NULL )
Msg::error("Problem in resetTableImages");
m->addTableImage(*t);
}
}
示例2: initializeFranchiseHq
void FranchiseHq::initializeFranchiseHq(std::vector<MenuItemInfo*>& mi, std::vector<TableInfo*>& ti, std::vector<double>& si) {
// add the menu items to the franchise hq image
int i = 0;
for (std::vector<MenuItemInfo*>::iterator it=mi.begin(); it != mi.end(); it++)
{
// set the menu items
int idx = (*it)->getIndex();
double stickSize = si[i++];
long int parmSeed = (*it)->getInitialParameterSeed();
MenuItem* m = new MenuItem(ranPtr, modelPtr, settingsPtr, parmType, taxonNames, parmSeed);
m->setIndex(idx);
m->setStickLength(stickSize);
availableMenuItemIndices.erase(idx);
menuItems.insert( m );
}
// set the tables
std::set<int> restIds;
TableImageFactory& tif = TableImageFactory::tableImageFactoryInstance();
for (std::vector<TableInfo*>::iterator it=ti.begin(); it != ti.end(); it++)
{
int rIdx = (*it)->getRestaurantIndex();
int tIdx = (*it)->getTableIndex();
int mIdx = (*it)->getMenuItemIndex();
restIds.insert(rIdx);
TableImage* ti = tif.getTableImage();
ti->setRestaurantIndex( rIdx );
ti->setTableIndex( tIdx );
MenuItem* m = findMenuItemIndexed( mIdx );
if (m == NULL)
Msg::error("Cannot find menu item in Franchise Headquarters Image");
m->addTableImage(ti);
}
numRestaurants = restIds.size();
// make certain that the tables in the restaurants reflect the seating of their images in the head quarters
setTableMenuAssignments();
}