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

Method AddField

neo/game/script/Script_Program.cpp:318–332  ·  view source on GitHub ↗

================ idTypeDef::AddField Adds a new field to an object type. ================ */

Source from the content-addressed store, hash-verified

316================
317*/
318void idTypeDef::AddField( idTypeDef *fieldtype, const char *name ) {
319 if ( type != ev_object ) {
320 throw idCompileError( "idTypeDef::AddField : tried to add field to non-object type" );
321 }
322
323 parmTypes.Append( fieldtype );
324 idStr &parmName = parmNames.Alloc();
325 parmName = name;
326
327 if ( fieldtype->FieldType()->Inherits( &type_object ) ) {
328 size += type_object.Size();
329 } else {
330 size += fieldtype->FieldType()->Size();
331 }
332}
333
334/*
335================

Callers 1

ParseObjectDefMethod · 0.45

Calls 6

idCompileErrorClass · 0.70
AppendMethod · 0.45
AllocMethod · 0.45
InheritsMethod · 0.45
FieldTypeMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected