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

JHiScore Class Reference

#include <HiScore.hpp>

List of all members.

Public Methods

__inline JHiScore ()
__inline JHiScore (UINT Max)
virtual __inline ~JHiScore ()
__inline void enter (const JScore &s)
__inline Score * getScore (UINT pos)
void clear ()
void sort ()

Private Methods

 JHiScore (const JHiScore &src)
const JHiScore & operator= (const JHiScore &src)

Private Attributes

JScoreentry
UINT max


Constructor & Destructor Documentation

__inline JHiScore::JHiScore  
 

Definition at line 6 of file HiScore.inl.

00007   : max( 10 ), entry( NULL ) 
00008 {
00009   clear();
00010 }

__inline JHiScore::JHiScore UINT    Max
 

Definition at line 12 of file HiScore.inl.

00013   : max( Max ), entry( NULL ) 
00014 {
00015   clear();
00016 }

__inline JHiScore::~JHiScore   [virtual]
 

Definition at line 18 of file HiScore.inl.

00019 {
00020   if ( entry != NULL ) 
00021   {
00022     delete [] entry;
00023   }
00024 }

JHiScore::JHiScore const JHiScore &    src [private]
 


Member Function Documentation

JHiScore::clear  
 

Definition at line 6 of file HiScore.cpp.

Referenced by JHiScore().

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 }

__inline void JHiScore::enter const JScore   s
 

__inline Score * JHiScore::getScore UINT    pos
 

Definition at line 26 of file HiScore.inl.

00027 {
00028    if ( pos >= max ) return &entry[ max-1 ];
00029    return &entry[ pos ];
00030 }

const JHiScore& JHiScore::operator= const JHiScore &    src [private]
 

void JHiScore::sort  
 

Definition at line 21 of file HiScore.cpp.

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 }


Member Data Documentation

JScore* JHiScore::entry [private]
 

Definition at line 20 of file HiScore.hpp.

UINT JHiScore::max [private]
 

Definition at line 21 of file HiScore.hpp.


The documentation for this class was generated from the following files:
Generated on Sun Oct 14 18:48:50 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001