Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/etc/Games/HiScore.cpp

Go to the documentation of this file.
00001 #ifndef __J2K__JHiScore_CPP__
00002 #define __J2K__JHiScore_CPP__
00003 
00004 #include <j2k/etc/Games/HiScore.hpp>
00005 
00006 JHiScore::clear() 
00007 {
00008   if ( entry != NULL ) 
00009   {
00010     delete [] entry;
00011   }
00012 
00013   entry = new JScore[ max+1 ];
00014 
00015   for( size_t i = 0; i < max; i++ ) 
00016   {
00017     entry[ i ] = new JScore();
00018   }
00019 }
00020 
00021 void JHiScore::sort() 
00022 {
00023   register size_t i, j;
00024   JScore& temp;
00025 
00026   for (i = 0; i <= max; i++) 
00027     for (j = 0; j < max; j++) 
00028       if ( entry[j] < entry[j + 1] )
00029         {
00030            temp         = entry[ j ];
00031            entry[ j ]   = entry[ j+1 ];
00032            entry[ j+1 ] = temp;
00033         }
00034 }
00035 
00036 #endif
00037 

Generated on Sun Oct 14 18:46:31 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001