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


C++ Savegame::get_status方法代码示例

本文整理汇总了C++中Savegame::get_status方法的典型用法代码示例。如果您正苦于以下问题:C++ Savegame::get_status方法的具体用法?C++ Savegame::get_status怎么用?C++ Savegame::get_status使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Savegame的用法示例。


在下文中一共展示了Savegame::get_status方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Savegame

void
SavegameManager::store(Savegame& arg_savegame)
{
  Savegame* savegame = new Savegame(arg_savegame);
  SavegameTable::iterator i = find(savegame->get_filename());
  if (i == savegames.end())
  { // don't know anything about the savegame
    savegames.push_back(savegame);
  }
  else
  { // already have such a savegame
    if ((*i)->get_status() == Savegame::FINISHED
        && savegame->get_status() == Savegame::ACCESSIBLE)
    { // saved savegame is better then new game
      delete savegame;
    }
    else
    { // new game is better or equal, save it
      delete *i;
      *i = savegame;
    }
  }

  flush();
}
开发者ID:jcs12311,项目名称:pingus,代码行数:25,代码来源:savegame_manager.cpp

示例2: int

void
Levelset::refresh()
{
  for(std::vector<Level*>::iterator i = levels.begin(); i != levels.end(); ++i)
    {
      Savegame* savegame = SavegameManager::instance()->get((*i)->resname);

      if (savegame)
        {
          (*i)->accessible = (savegame->get_status() != Savegame::NONE);
          (*i)->finished   = (savegame->get_status() == Savegame::FINISHED);
        }
    }

  if (!levels.empty())
    {
      levels[0]->accessible = true; 
      for(std::vector<Level*>::size_type i = 0; i < levels.size()-1; ++i)
        if (levels[i]->finished)
          levels[i+1]->accessible = true;
    }

  completion = 0;
  for(std::vector<Level*>::iterator i = levels.begin(); i != levels.end(); ++i)
    if ((*i)->finished)
      completion += 1;
  completion = Math::clamp(0, completion * 100 / int(levels.size()), 100);
}
开发者ID:jinguoliang,项目名称:Maemo-pingus,代码行数:28,代码来源:levelset.cpp

示例3:

bool
LevelDot::finished()
{
  Savegame* savegame = SavegameManager::instance()->get(plf.get_resname());
  if (savegame && savegame->get_status() == Savegame::FINISHED)
    return true;
  else
    return false;
}
开发者ID:jcs12311,项目名称:pingus,代码行数:9,代码来源:level_dot.cpp

示例4: savegame_

void
LevelDot::unlock()
{
  Savegame* savegame = SavegameManager::instance()->get(plf.get_resname());
  if (savegame == 0 || savegame->get_status() == Savegame::NONE)
  {
    Savegame savegame_(plf.get_resname(),
                       Savegame::ACCESSIBLE,
                       0,
                       0);
    SavegameManager::instance()->store(savegame_);
  }
  else
  {
  }
}
开发者ID:jcs12311,项目名称:pingus,代码行数:16,代码来源:level_dot.cpp


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