================ idGameEdit::MapGetEntitiesMatchignClassWithString ================ */
| 1104 | ================ |
| 1105 | */ |
| 1106 | int idGameEdit::MapGetEntitiesMatchingClassWithString( const char *classname, const char *match, const char *list[], const int max ) const { |
| 1107 | idMapFile *mapFile = gameLocal.GetLevelMap(); |
| 1108 | int count = 0; |
| 1109 | if ( mapFile ) { |
| 1110 | int entCount = mapFile->GetNumEntities(); |
| 1111 | for ( int i = 0 ; i < entCount; i++ ) { |
| 1112 | idMapEntity *ent = mapFile->GetEntity(i); |
| 1113 | if (ent) { |
| 1114 | idStr work = ent->epairs.GetString("classname"); |
| 1115 | if ( work.Icmp( classname ) == 0 ) { |
| 1116 | if ( match && *match ) { |
| 1117 | work = ent->epairs.GetString( "soundgroup" ); |
| 1118 | if ( count < max && work.Icmp( match ) == 0 ) { |
| 1119 | list[count++] = ent->epairs.GetString( "name" ); |
| 1120 | } |
| 1121 | } else if ( count < max ) { |
| 1122 | list[count++] = ent->epairs.GetString( "name" ); |
| 1123 | } |
| 1124 | } |
| 1125 | } |
| 1126 | } |
| 1127 | } |
| 1128 | return count; |
| 1129 | } |
| 1130 | |
| 1131 | |
| 1132 | /* |
no test coverage detected