// 랭크정렬 void CRankDlg::SortRank(CString rankName) { int row =rankList.GetItemCount () ; int pt1, pt2, cnt1, cnt2 ; // 점수와 클릭수를 기준으로 정렬한다 for (int i =0 ; i < row -1 ; i++) for (int j =i +1 ; j < row ; j++) { if(CompareRank (&pt1, &pt2, 2, i, j)) SwapRank(i, j); if (pt1 == pt2) if(CompareRank (&cnt1, &cnt2, 4, i, j)) SwapRank(i, j); } // 정렬 NaturalMergeSort (0, row) ; }
int BattleroomListCtrl::CompareOneCrit(DataType u1, DataType u2, int col, int dir) const { if ( col == m_status_column_index ) return dir * CompareStatus( u1, u2, m_battle ); if ( col == m_ingame_column_index ) return dir * CompareLobbyStatus( u1, u2 ); if ( col == m_faction_column_index ) return dir * CompareSide( u1, u2 ); if ( col == m_colour_column_index ) return dir * CompareColor( u1, u2 ); if ( col == m_country_column_index ) return dir * compareSimple( u1, u2 ); if ( col == m_rank_column_index ) return dir * CompareRank( u1, u2 ); if ( col == m_nick_column_index ) return dir * u1->GetNick().CmpNoCase( u2->GetNick() ); if ( col == m_team_column_index ) return dir * CompareTeam( u1, u2 ); if ( col == m_ally_column_index ) return dir * CompareAlly( u1, u2 ); if ( col == m_resourcebonus_column_index ) return dir * CompareHandicap( u1, u2 ); return 0; }