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