本文整理汇总了C++中StarSystem::Name方法的典型用法代码示例。如果您正苦于以下问题:C++ StarSystem::Name方法的具体用法?C++ StarSystem::Name怎么用?C++ StarSystem::Name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StarSystem
的用法示例。
在下文中一共展示了StarSystem::Name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
MsnEditNavDlg::ScrapeForm()
{
if (mission) {
if (txt_name) {
mission->SetName(txt_name->GetText());
}
if (cmb_type) {
mission->SetType(cmb_type->GetSelectedIndex());
if (mission_info)
mission_info->type = cmb_type->GetSelectedIndex();
}
Galaxy* galaxy = Galaxy::GetInstance();
StarSystem* system = 0;
if (galaxy)
system = galaxy->GetSystem(cmb_system->GetSelectedItem());
if (cmb_system && system) {
mission->ClearSystemList();
mission->SetStarSystem(system);
if (mission_info)
mission_info->system = system->Name();
}
if (cmb_region) {
mission->SetRegion(cmb_region->GetSelectedItem());
if (mission_info)
mission_info->region = cmb_region->GetSelectedItem();
}
SetSystem(system);
}
}
示例2: FormatDayTime
void
DebriefDlg::Show()
{
FormWindow::Show();
Game::SetTimeCompression(1);
mission = 0;
campaign = Campaign::GetCampaign();
sim = Sim::GetSim();
if (sim)
ship = sim->GetPlayerShip();
if (campaign)
mission = campaign->GetMission();
if (mission_name) {
if (mission)
mission_name->SetText(mission->Name());
else
mission_name->SetText(Game::GetText("DebriefDlg.mission-name"));
}
if (mission_system) {
mission_system->SetText("");
if (mission) {
StarSystem* sys = mission->GetStarSystem();
if (sys)
mission_system->SetText(sys->Name());
}
}
if (mission_sector) {
mission_sector->SetText("");
if (mission) {
MissionElement* elem = mission->GetElements()[0];
if (elem)
mission_sector->SetText(elem->Region());
}
}
if (mission_time_start) {
if (mission) {
char txt[32];
FormatDayTime(txt, mission->Start());
mission_time_start->SetText(txt);
}
}
if (objectives) {
bool found_objectives = false;
if (sim && sim->GetPlayerElement()) {
Text text;
Element* elem = sim->GetPlayerElement();
for (int i = 0; i < elem->NumObjectives(); i++) {
Instruction* obj = elem->GetObjective(i);
text += Text("* ") + obj->GetDescription() + Text("\n");
found_objectives = true;
}
objectives->SetText(text);
}
if (!found_objectives) {
if (mission)
objectives->SetText(mission->Objective());
else
objectives->SetText(Game::GetText("DebriefDlg.unspecified"));
}
}
if (situation) {
if (mission)
situation->SetText(mission->Situation());
else
situation->SetText(Game::GetText("DebriefDlg.unknown"));
}
if (mission_score) {
mission_score->SetText(Game::GetText("DebriefDlg.no-stats"));
if (ship) {
for (int i = 0; i < ShipStats::NumStats(); i++) {
ShipStats* stats = ShipStats::GetStats(i);
if (stats && !strcmp(ship->Name(), stats->GetName())) {
stats->Summarize();
Player* player = Player::GetCurrentPlayer();
int points = stats->GetPoints() + stats->GetCommandPoints();
if (player && sim)
points = player->GetMissionPoints(stats, sim->StartTime()) + stats->GetCommandPoints();
//.........这里部分代码省略.........