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

C:/temp/src/j2k/etc/Games/Score.inl

Go to the documentation of this file.
00001 #ifndef __J2K__JScore_INL__
00002 #define __J2K__JScore_INL__
00003 
00004 #include <j2k/etc/Games/Score.hpp>
00005 
00006 inline JScore::JScore()
00007   : score( 0 ), name( " " ) { }
00008 
00009 inline JScore::JScore( ULONG pts )
00010   : score( pts ), name( " " ) { }
00011 
00012 inline JScore::JScore( ULONG pts, const char* n )
00013   : score( pts ), name( strdup( n ) ) { }
00014 
00015 inline JScore::JScore( const JScore& src )
00016   : score( src.score ), name( strdup( src.name ) ) { }
00017 
00018 inline JScore::~JScore() {
00019   if ( name != NULL ) {
00020     delete [] name;
00021   }
00022 }
00023 
00024 inline const JScore& JScore::operator=( const JScore& src ) 
00025 {
00026   score = src.score;
00027   name  = strdup( src.name );
00028 }
00029 
00030 inline BOOL operator==( const JScore& right ) 
00031 {
00032   if ( score != right.score ) return FALSE;
00033   return !strcmp( name, right.name ); 
00034 }
00035 
00036 inline const JScore& operator>(  const JScore& right ) 
00037 {
00038   return ( score > right.score );
00039 }
00040 
00041 inline const JScore& operator<(  const JScore& right ) 
00042 {
00043   return ( score < right.score );
00044 }
00045 
00046 inline void JScore::setName( const char* n ) 
00047 {
00048   name = strdup( n );
00049 }
00050 
00051 inline void JScore::setScore(ULONG pts) 
00052 {
00053   score = pts;
00054 }
00055 
00056 inline const char* JScore::getName() 
00057 {
00058   return name;
00059 }
00060 
00061 inline ULONG JScore::getScore()
00062 {
00063   return score;
00064 }
00065 
00066 #endif

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