Exemplo n.º 1
0
int BattleListCtrl::CompareOneCrit( DataType u1, DataType u2, int col, int dir ) const
{
    switch ( col ) {
        case 0: return dir * CompareStatus( u1, u2 );
        case 1:
        {
					try
					{
        	 return dir * u1->GetFounder().GetCountry().CmpNoCase( u2->GetFounder().GetCountry() );
        	 }catch(...){}
					break;
        }
        case 2: return dir * compareSimple( u1->GetRankNeeded(), u2->GetRankNeeded() );
        case 3: return dir * u1->GetDescription().CmpNoCase( u2->GetDescription() );
		case 4: return dir * u1->GetHostMapName().CmpNoCase( u2->GetHostMapName() );
		case 5: return dir * u1->GetHostModName().CmpNoCase( u2->GetHostModName() );
        case 6:
        {
        	try
					{
        	 return dir * u1->GetFounder().GetNick().CmpNoCase( u2->GetFounder().GetNick() );
        	 }catch(...){}
        	 break;
        }
        case 7: return dir * compareSimple( u1->GetSpectators(), u2->GetSpectators() );
        case 8: return dir * ComparePlayer( u1, u2 );
        case 9: return dir * compareSimple( u1->GetMaxPlayers(), u2->GetMaxPlayers() );
        case 10: return dir * compareSimple( u1->GetBattleRunningTime(), u2->GetBattleRunningTime());
		case 11: return dir * compareSimple( u1->GetEngineVersion(), u2->GetEngineVersion() );
        default: return 0;
    }
    return 0; // simply to avoid compiler warning
}
Exemplo n.º 2
0
void BattleListCtrl::OnDLMap( wxCommandEvent& /*unused*/  )
{
    if ( m_selected_index > 0 &&  (long)m_data.size() > m_selected_index ) {
        DataType dt = m_data[m_selected_index];
        ui().Download( _T("map"), dt->GetHostMapName(), dt->GetHostMapHash() );
    }
}