Exemplo n.º 1
0
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;
}
Exemplo n.º 2
0
int NickListCtrl::CompareOneCrit(DataType u1, DataType u2, int col, int dir) const
{
	if (!(u1 && u2))
		return 0;
	switch (col) {
		case 0:
			return dir * CompareUserStatus(u1, u2);
		case 1:
			return dir * TowxString(u2->GetCountry()).CmpNoCase(TowxString(u1->GetCountry()));
		case 2:
			return dir * compareSimple(TowxString(u2->GetStatus().rank), TowxString(u1->GetStatus().rank));
		case 3:
			return dir * TowxString(u2->GetNick()).CmpNoCase(TowxString(u1->GetNick()));
		default:
			return 0;
	}
}