/[enigma]/enigma/src/game.cc
ViewVC logotype

Diff of /enigma/src/game.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.45.2.2 by dheck, Fri Sep 26 14:49:40 2003 UTC revision 1.45.2.3 by dheck, Sun Sep 28 20:47:54 2003 UTC
# Line 827  enigma::StartGame (LevelPack *lp, unsign Line 827  enigma::StartGame (LevelPack *lp, unsign
827    
828  unsigned  unsigned
829  enigma::NextLevel (LevelPack *lp, unsigned levelidx, unsigned max_available,  enigma::NextLevel (LevelPack *lp, unsigned levelidx, unsigned max_available,
830                     bool skip_solved, bool skip_todo_and_unnamed)                     bool skip_solved, bool skip_todo)
831  {  {
832      // returns 0 if none found      // returns 0 if none found
833      unsigned found = 0;      unsigned found = 0;
# Line 840  enigma::NextLevel (LevelPack *lp, unsign Line 840  enigma::NextLevel (LevelPack *lp, unsign
840    
841          const LevelInfo *info = lp->get_info(levelidx);          const LevelInfo *info = lp->get_info(levelidx);
842    
843          if (skip_todo_and_unnamed) { // skip "todo" and unnamed levels          if (skip_todo) { // skip "todo" levels
844              if (info->filename == "todo") {              if (info->filename == "todo") {
845                  printf("Skipping 'todo' level\n");                  printf("Skipping 'todo' level\n");
846                  continue;                  continue;
847              }              }
848              if (info->name == "") {  //             if (info->name == "") {
849                  printf("Skipping unnamed level '%s'\n", info->filename.c_str());  //                 printf("Skipping unnamed level '%s'\n", info->filename.c_str());
850                  continue;  //                 continue;
851              }  //             }
852          }          }
853    
854          bool available = levelidx <= max_available;  //        bool available = levelidx <= max_available;
855            bool available = true;  // level locking disabled for the time being!
856    
857          if (skip_solved || !available) {          if (skip_solved || !available) {
858              options::LevelStatus *ls = options::GetLevelStatus(lp->get_name(), info->filename);              options::LevelStatus *ls = options::GetLevelStatus(lp->get_name(), info->filename);
# Line 870  enigma::NextLevel (LevelPack *lp, unsign Line 871  enigma::NextLevel (LevelPack *lp, unsign
871  }  }
872    
873  unsigned  unsigned
874  enigma::HighestAvailableLevel(LevelPack *lp) {  enigma::HighestAvailableLevel(LevelPack *lp)
875    {
876      if( options::WizardMode || // No restriction in WizardMode      if( options::WizardMode || // No restriction in WizardMode
877          lp->get_name() == "TestLevels") // and test-levelpack          lp->get_name() == "TestLevels") // and test-levelpack
878          return lp->size()-1;          return lp->size()-1;
# Line 910  enigma::LevelIsLocked (LevelPack *lp, si Line 912  enigma::LevelIsLocked (LevelPack *lp, si
912      return !(index <= max_available || finished >= options::Difficulty);      return !(index <= max_available || finished >= options::Difficulty);
913  }  }
914    
915    unsigned
916    enigma::CountSolvedLevels (LevelPack *lp)
917    {
918        unsigned cnt = 0;
919        for (unsigned i=0; i<lp->size(); ++i)
920        {
921            if (options::LevelStatus *ls = GetStatus(lp, i))
922                if (ls->finished)
923                    ++cnt;
924        }
925        return cnt;
926    }
927    
928    
929    

Legend:
Removed from v.1.45.2.2  
changed lines
  Added in v.1.45.2.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26