MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / MatchesVirtualFunction

Method MatchesVirtualFunction

neo/game/script/Script_Program.cpp:264–292  ·  view source on GitHub ↗

================ idTypeDef::MatchesVirtualFunction Returns true if both functions' base types and parameters match ================ */

Source from the content-addressed store, hash-verified

262================
263*/
264bool idTypeDef::MatchesVirtualFunction( const idTypeDef &matchfunc ) const {
265 int i;
266
267 if ( this == &matchfunc ) {
268 return true;
269 }
270
271 if ( ( type != matchfunc.type ) || ( auxType != matchfunc.auxType ) ) {
272 return false;
273 }
274
275 if ( parmTypes.Num() != matchfunc.parmTypes.Num() ) {
276 return false;
277 }
278
279 if ( parmTypes.Num() > 0 ) {
280 if ( !parmTypes[ 0 ]->Inherits( matchfunc.parmTypes[ 0 ] ) ) {
281 return false;
282 }
283 }
284
285 for( i = 1; i < matchfunc.parmTypes.Num(); i++ ) {
286 if ( parmTypes[ i ] != matchfunc.parmTypes[ i ] ) {
287 return false;
288 }
289 }
290
291 return true;
292}
293
294/*
295================

Callers 1

AddFunctionMethod · 0.45

Calls 2

NumMethod · 0.45
InheritsMethod · 0.45

Tested by

no test coverage detected