예제 #1
0
start_location *start_location::find( const std::string ident ) {
    location_map::iterator found = _locations.find( ident );
    if(found != _locations.end()){
        return &(found->second);
    } else {
        debugmsg("Tried to get invalid location: %s", ident.c_str());
        static start_location null_location;
        return &null_location;
    }
}
예제 #2
0
const start_location &string_id<start_location>::obj() const
{
    const auto iter = _locations.find( *this );
    if( iter != _locations.end() ) {
        return iter->second;
    } else {
        debugmsg( "Tried to get invalid start location: %s", c_str() );
        static const start_location dummy{};
        return dummy;
    }
}