rsked/playermgr.cc
/// Check that at least one player is potentially usable.
/// * May throw a Player_startup_exception if none usable.
///
Check that at least one player is potentially usable.
May throw a Player_startup_exception if none usable.
Check that at least one player is potentially usable . May throw a Player_startup_exception if none usable .
void Player_manager::check_minimally_usable()
{
    spPlayer annunciator = m_players[AnnName];
    if (not annunciator or
        not annunciator->is_usable()) {
            LOG_WARNING(Lgr) << "Player_mgr: Annunciator is not available, "
                "which is highly undesirable.";
    }
    unsigned nu=0;
    for ( auto pn : RankedPlayers ) {
        spPlayer sp = m_players[ pn ];
        if (sp and sp->is_usable()) {
            ++nu;
        }
    }
    if (nu) {
        if (1 == nu) {
            LOG_WARNING(Lgr) << "Player_mgr: only *1* usable player";
        } else {
            LOG_INFO(Lgr) << "Player_mgr: " << nu << " usable players";
        }
    } else {
        LOG_ERROR(Lgr) << "Player_mgr: NONE of the players seems usable.";
        throw Player_startup_exception();
    }
}
void Player_manager :: check_minimally_usable ( ) { spPlayer annunciator = m_players [ AnnName ] ; if ( not annunciator or not annunciator -> is_usable ( ) ) { LOG_WARNING ( Lgr ) << " " " " ; } unsigned nu = 0 ; for ( auto pn : RankedPlayers ) { spPlayer sp = m_players [ pn ] ; if ( sp and sp -> is_usable ( ) ) { ++ nu ; } } if ( nu ) { if ( 1 == nu ) { LOG_WARNING ( Lgr ) << " " ; } else { LOG_INFO ( Lgr ) << " " << nu << " " ; } } else { LOG_ERROR ( Lgr ) << " " ; throw Player_startup_exception ( ) ; } }
Check that at least one player is potentially usable.
Check that at least one player is potentially usable .