Skip to content

Commit

Permalink
Games|libdoomsday: Checking whether a game is playable at all
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Mar 5, 2017
1 parent 6e2af5f commit e7f18fc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doomsday/apps/libdoomsday/include/doomsday/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ class LIBDOOMSDAY_PUBLIC Game : public de::IObject

bool isPlayable() const;

bool isPlayableWithDefaultPackages() const;

/**
* Provides access to the manifests for efficent traversals.
*/
Expand Down
10 changes: 10 additions & 0 deletions doomsday/apps/libdoomsday/src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,16 @@ bool Game::isPlayable() const
return allStartupFilesFound();
}

bool Game::isPlayableWithDefaultPackages() const
{
for (String const &pkg : d->requiredPackages)
{
if (!App::packageLoader().isAvailable(pkg))
return false;
}
return true;
}

Game::Status Game::status() const
{
if (App_GameLoaded() && &DoomsdayApp::game() == this)
Expand Down

0 comments on commit e7f18fc

Please sign in to comment.