本文整理汇总了C++中Sim::GetMission方法的典型用法代码示例。如果您正苦于以下问题:C++ Sim::GetMission方法的具体用法?C++ Sim::GetMission怎么用?C++ Sim::GetMission使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sim
的用法示例。
在下文中一共展示了Sim::GetMission方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BeginPaint
bool
StarServer::OnPaint()
{
PAINTSTRUCT paintstruct;
HDC hdc = BeginPaint(hwnd, &paintstruct);
Text txt_title = title_text;
Text txt_mode;
Text txt_users = Game::GetText("server.no-users");
char buf[256];
txt_title += " ";
txt_title += versionInfo;
switch (game_mode) {
case LOAD_MODE:
case MENU_MODE:
txt_mode = Game::GetText("server.mode.lobby");
if (lobby_server) {
sprintf_s(buf, Game::GetText("server.users").data(), lobby_server->NumUsers());
txt_users = buf;
}
break;
case PLAY_MODE:
txt_mode = Game::GetText("server.mode.active");
if (lobby_server) {
sprintf_s(buf, Game::GetText("server.users-and-players").data(), lobby_server->NumUsers(), NetGame::NumPlayers());
}
else {
sprintf_s(buf, Game::GetText("server.players").data(), NetGame::NumPlayers());
}
txt_users = buf;
break;
default:
txt_mode = Game::GetText("server.mode.other");
break;
}
if (lobby_server && lobby_server->GetStatus() == NetServerInfo::PERSISTENT)
txt_mode += " " + Game::GetText("server.alt.persistent");
if (paused)
txt_mode += " " + Game::GetText("server.alt.paused");
TextOut(hdc, 4, 4, txt_title, txt_title.length());
TextOut(hdc, 4, 22, txt_mode, txt_mode.length());
TextOut(hdc, 4, 40, txt_users, txt_users.length());
Sim* sim = Sim::GetSim();
if (sim && sim->GetMission()) {
Mission* mission = sim->GetMission();
Text txt_msn = Game::GetText("server.mission");
txt_msn += mission->Name();
TextOut(hdc, 4, 58, txt_msn, txt_msn.length());
}
EndPaint(hwnd, &paintstruct);
return true;
}