📄 pokerhand.cpp
字号:
// {{{RME classifier 'Logical View::CardDefinitions::PokerHand'#if defined( PRAGMA ) && ! defined( PRAGMA_IMPLEMENTED )#pragma implementation "PokerHand.h"#endif#include <RTSystem/CardGameComponent.h>#include <PokerHand.h>#include <Card.h>// {{{RME tool 'OT::Cpp' property 'ImplementationPreface'// {{{USR// }}}USR// }}}RMEstatic Hand * rtg_PokerHand_super_accessor( PokerHand * target ){ return target;}static void rtg_PokerHand_init( const RTObject_class * type, PokerHand * target ){ (void)new( target ) PokerHand;}static void rtg_PokerHand_copy( const RTObject_class * type, PokerHand * target, const PokerHand * source ){ (void)new( target ) PokerHand( *source );}static void rtg_PokerHand_destroy( const RTObject_class * type, PokerHand * target ){ target->~PokerHand();}const RTObject_class RTType_PokerHand ={ &RTType_Hand , (RTSuperAccessFunction)rtg_PokerHand_super_accessor , "PokerHand" , (RTVersionId)0 , (RTFieldOffset)sizeof( PokerHand ) , (RTInitFunction)rtg_PokerHand_init , (RTCopyFunction)rtg_PokerHand_copy#if OBJECT_DECODE , RTstruct_decode#endif#if OBJECT_ENCODE , RTstruct_encode#endif , (RTDestroyFunction)rtg_PokerHand_destroy , 0 , (const RTFieldDescriptor *)0};// {{{RME tool 'OT::Cpp' property 'GenerateDestructor'PokerHand::~PokerHand( void ){}// }}}RME// {{{RME tool 'OT::Cpp' property 'GenerateCopyConstructor'PokerHand::PokerHand( const PokerHand & rtg_arg ) : Hand( rtg_arg ){}// }}}RME// {{{RME tool 'OT::Cpp' property 'GenerateAssignmentOperator'PokerHand & PokerHand::operator=( const PokerHand & rtg_arg ){ if( this != &rtg_arg ) Hand::operator=( rtg_arg ); return *this;}// }}}RME// {{{RME operation 'PokerHand()'PokerHand::PokerHand( void ) // {{{RME tool 'OT::Cpp' property 'ConstructorInitializer' // {{{USR : Hand(5) // }}}USR // }}}RME{ // {{{USR // }}}USR}// }}}RME// {{{RME operation 'value()'int PokerHand::value( void ){ // {{{USR // Evaluates a hand and returns the following results: // 1 - one pair // 2 - two pairs // 3 - three of a kind // 4 - full house // 6 - four of a kind int result = 0; for( int i = 0 ; i < size() ; i++ ) { for( int j = i + 1; j < size() ; j++ ) { if( _fivecards[i].rank == _fivecards[j].rank ) result++; } } return result; // }}}USR}// }}}RME#if OBJECT_DECODERTTypeInstaller rtg_PokerHand_installer( RTType_PokerHand );#endif// {{{RME tool 'OT::Cpp' property 'ImplementationEnding'// {{{USR// }}}USR// }}}RME// }}}RME
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -