enigma-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Enigma-cvs] enigma/src levels.hh,1.6,1.7


From: Ralf Westram <address@hidden>
Subject: [Enigma-cvs] enigma/src levels.hh,1.6,1.7
Date: Thu, 06 Nov 2003 07:20:10 +0000

Update of /cvsroot/enigma/enigma/src
In directory subversions:/tmp/cvs-serv14494/src

Modified Files:
        levels.hh 
Log Message:
- added fields for par player names
- added get_best_times()



Index: levels.hh
===================================================================
RCS file: /cvsroot/enigma/enigma/src/levels.hh,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** levels.hh   3 Nov 2003 14:22:29 -0000       1.6
--- levels.hh   6 Nov 2003 07:20:07 -0000       1.7
***************
*** 52,83 ****
          // Variables.
          GameType type;
!         string   filename;      // Filename of the level _without_ extension
!         string   name;          // Complete name of the level
!         string   author;        // Author of the level
!         int      revision;      // Revision # of this level
!         bool     has_easymode;  // whether level has an easymode
!         int      best_time_easy; // Best time in seconds (for easy mode)
!         int      best_time_normal; // (for normal mode)
!         int      best_moves;    // Least moves to solve level
!         string   hint1, hint2;  // Hints for solving this level
  
          // Methods
          enum { DEFAULT_TIME = 99*60+59 };
  
!         LevelInfo(GameType       gt,
!                   const string  &fn,
!                   const string  &n,
!                   const string  &a,
!                   int            rev,
!                   bool           easy,
!                   int            par_time_easy,
!                   int            par_time_normal,
!                   int            par_moves,
!                   const string&  h1,
!                   const string&  h2)
              : type(gt), filename(fn), name(n), author(a), revision(rev),
                has_easymode(easy),
                best_time_easy(par_time_easy == -1 ? DEFAULT_TIME : 
par_time_easy),
                best_time_normal(par_time_normal == -1 ? DEFAULT_TIME : 
par_time_normal),
                best_moves(par_moves), hint1(h1), hint2(h2)
          {
--- 52,89 ----
          // Variables.
          GameType type;
!         string   filename;              // Filename of the level _without_ 
extension
!         string   name;                  // Complete name of the level
!         string   author;                // Author of the level
!         int      revision;              // Revision # of this level
!         bool     has_easymode;          // whether level has an easymode
!         int      best_time_easy;        // Best time in seconds (for easy 
mode)
!         int      best_time_normal;      // (for normal mode)
!         string   best_time_easy_by;     // player name(s) for 'best_time_easy'
!         string   best_time_normal_by;   // same for 'best_time_normal'
!         int      best_moves;            // Least moves to solve level
!         string   hint1, hint2;          // Hints for solving this level
  
          // Methods
          enum { DEFAULT_TIME = 99*60+59 };
  
!         LevelInfo(GameType      gt,
!                   const string& fn,
!                   const string& n,
!                   const string& a,
!                   int           rev,
!                   bool          easy,
!                   int           par_time_easy,
!                   const string& par_time_easy_by,
!                   int           par_time_normal,
!                   const string& par_time_normal_by,
!                   int           par_moves,
!                   const string& h1,
!                   const string& h2)
              : type(gt), filename(fn), name(n), author(a), revision(rev),
                has_easymode(easy),
                best_time_easy(par_time_easy == -1 ? DEFAULT_TIME : 
par_time_easy),
+               best_time_easy_by(par_time_easy == -1 ? "" : par_time_easy_by),
                best_time_normal(par_time_normal == -1 ? DEFAULT_TIME : 
par_time_normal),
+               best_time_normal_by(par_time_normal == -1 ? "" : 
par_time_normal_by),
                best_moves(par_moves), hint1(h1), hint2(h2)
          {
***************
*** 98,104 ****
  
          // Variables.
!         int  time_easy, time_hard; // Best time in seconds (-1: use level 
default)
!         int  finished;          // Level solved? 0 = 
no,1=easy,2=hard,3=easy&hard
!         int  solved_revision;    // Revision #  that was solved
      };
  
--- 104,110 ----
  
          // Variables.
!         int time_easy, time_hard;       // Best time in seconds (-1: use 
level default)
!         int finished;                   // Level solved? 0 = 
no,1=easy,2=hard,3=easy&hard
!         int solved_revision;            // Revision #  that was solved
      };
  
***************
*** 137,140 ****
--- 143,151 ----
          virtual bool may_have_previews() const = 0;
      };
+ 
+     // sets best_par_time and best_user_time for current difficulty level (-1 
if undefined)
+     // (best_par_name != 0 -> is filled with par-player-name)
+     void get_best_times(const LevelInfo *li, const LevelStatus *ls,
+                         int& best_par_time, int& best_user_time, string 
*best_par_name);
  
  }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]