本文整理汇总了C++中ListIter::SetName方法的典型用法代码示例。如果您正苦于以下问题:C++ ListIter::SetName方法的具体用法?C++ ListIter::SetName怎么用?C++ ListIter::SetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListIter
的用法示例。
在下文中一共展示了ListIter::SetName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: new
void
MsnWepDlg::OnLoadout(AWEvent* event)
{
if (!elem) return;
ShipDesign* design = (ShipDesign*) elem->GetDesign();
ShipLoad* shipload = 0;
if (loadout_list && design) {
int index = loadout_list->GetListIndex();
Text loadname = loadout_list->GetItemText(index);
ListIter<ShipLoad> sl = (List<ShipLoad>&) design->loadouts;
while (++sl) {
if (sl->name == loadname) {
shipload = sl.value();
}
}
if (!shipload) return;
if (lbl_weight) {
char weight[32];
sprintf_s(weight, "%d kg", (int) ((design->mass + shipload->mass) * 1000));
lbl_weight->SetText(weight);
}
if (elem->Loadouts().size() < 1) {
MissionLoad* l = new(__FILE__,__LINE__) MissionLoad(-1, shipload->name);
elem->Loadouts().append(l);
}
else {
ListIter<MissionLoad> l = elem->Loadouts();
while (++l) {
// if the player chooses a std loadout,
// tell the sim loader to use a named
// loadout from the ship design:
l->SetName(shipload->name);
}
}
int nstations = design->hard_points.size();
int* loadout = shipload->load;
for (int i = 0; i < 8; i++)
loads[i] = -1;
for (int i = 0; i < nstations; i++)
loads[i + first_station] = PointIndexToLoad(i, loadout[i]);
for (int i = 0; i < 8; i++) {
for (int n = 0; n < 8; n++) {
btn_load[i][n]->SetPicture(i == loads[n] ? led_on: led_off);
}
}
}
}