本文整理汇总了C++中Mission::Identity方法的典型用法代码示例。如果您正苦于以下问题:C++ Mission::Identity方法的具体用法?C++ Mission::Identity怎么用?C++ Mission::Identity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mission
的用法示例。
在下文中一共展示了Mission::Identity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowCmdDlg
void
CmdMissionsDlg::Show()
{
mode = MODE_MISSIONS;
FormWindow::Show();
ShowCmdDlg();
campaign = Campaign::GetCampaign();
if (campaign) {
if (lst_missions) {
lst_missions->ClearItems();
Player* player = Player::GetCurrentPlayer();
List<MissionInfo>& missions = campaign->GetMissionList();
for (int i = 0; i < missions.size(); i++) {
MissionInfo* info = missions[i];
lst_missions->AddItemWithData(info->name, info->id);
Mission* m = info->mission;
if (m) {
if (m->Type() == Mission::TRAINING && player->HasTrained(m->Identity())) {
lst_missions->SetItemText(i, 1, Game::GetText("CmdMissionsDlg.training"));
}
else {
lst_missions->SetItemText(i, 1, m->TypeName());
}
}
char start_time[64];
FormatDayTime(start_time, info->start);
lst_missions->SetItemText(i, 2, start_time);
}
}
}
}
示例2: if
void
CmdMissionsDlg::ExecFrame()
{
CmdDlg::ExecFrame();
if (campaign) {
List<MissionInfo>& missions = campaign->GetMissionList();
Player* player = Player::GetCurrentPlayer();
if (missions.size() > lst_missions->NumItems()) {
while (missions.size() > lst_missions->NumItems()) {
MissionInfo* info = missions[lst_missions->NumItems()];
int i = lst_missions->AddItemWithData(info->name, info->id) - 1;
Mission* m = info->mission;
if (m) {
if (m->Type() == Mission::TRAINING && player->HasTrained(m->Identity())) {
lst_missions->SetItemText(i, 1, Game::GetText("CmdMissionsDlg.training"));
}
else {
lst_missions->SetItemText(i, 1, m->TypeName());
}
}
char start_time[64];
FormatDayTime(start_time, info->start);
lst_missions->SetItemText(i, 2, start_time);
}
}
else if (missions.size() < lst_missions->NumItems()) {
lst_missions->ClearItems();
for (int i = 0; i < missions.size(); i++) {
MissionInfo* info = missions[i];
lst_missions->AddItemWithData(info->name, info->id);
Mission* m = info->mission;
if (m) {
if (m->Type() == Mission::TRAINING && player->HasTrained(m->Identity())) {
lst_missions->SetItemText(i, 1, Game::GetText("CmdMissionsDlg.training"));
}
else {
lst_missions->SetItemText(i, 1, m->TypeName());
}
}
char start_time[64];
FormatDayTime(start_time, info->start);
lst_missions->SetItemText(i, 2, start_time);
}
}
else if (missions.size() > 0 && lst_missions->NumItems() > 0) {
int id = lst_missions->GetItemData(0);
MissionInfo* info = campaign->GetMissionInfo(id);
if (!info) {
int seln = -1;
int seln_id = 0;
for (int i = 0; i < lst_missions->NumItems(); i++)
if (lst_missions->IsSelected(i))
seln = i;
if (seln >= 0)
seln_id = lst_missions->GetItemData(seln);
lst_missions->ClearItems();
seln = -1;
for (int i = 0; i < missions.size(); i++) {
MissionInfo* info = missions[i];
lst_missions->AddItemWithData(info->name, info->id);
Mission* m = info->mission;
if (m) {
if (m->Type() == Mission::TRAINING && player->HasTrained(m->Identity())) {
lst_missions->SetItemText(i, 1, Game::GetText("CmdMissionsDlg.training"));
}
else {
lst_missions->SetItemText(i, 1, m->TypeName());
}
}
char start_time[64];
FormatDayTime(start_time, info->start);
lst_missions->SetItemText(i, 2, start_time);
if (info->id == seln_id)
seln = i;
}
if (seln >= 0)
lst_missions->SetSelected(seln);
}
}
bool found = false;
//.........这里部分代码省略.........