当前位置: 首页>>代码示例>>C++>>正文


C++ Sim::GetMission方法代码示例

本文整理汇总了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;
}
开发者ID:Banbury,项目名称:starshatter-open,代码行数:62,代码来源:StarServer.cpp


注:本文中的Sim::GetMission方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。