本文整理汇总了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();
}
示例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);
}
示例3:
bool
LevelDot::finished()
{
Savegame* savegame = SavegameManager::instance()->get(plf.get_resname());
if (savegame && savegame->get_status() == Savegame::FINISHED)
return true;
else
return false;
}
示例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
{
}
}