UFO: Alien Invasion
cp_component.h File Reference

Header file for Aircraft and item components. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  components_t
 The definition of a "components" entry (i.e. an assembly of several items) parsed from a ufo-file. More...
 

Macros

#define MAX_ASSEMBLIES   16
 
#define MAX_COMP   32
 
#define COMP_ITEMCOUNT_SCALED   -32768
 

Functions

components_tCOMP_GetComponentsByID (const char *id)
 Returns components definition by ID. More...
 
void COMP_ParseComponents (const char *name, const char **text)
 Parses one "components" entry in a .ufo file and writes it into the next free entry in xxxxxxxx (components_t). More...
 

Detailed Description

Header file for Aircraft and item components.

Definition in file cp_component.h.

Macro Definition Documentation

◆ COMP_ITEMCOUNT_SCALED

#define COMP_ITEMCOUNT_SCALED   -32768

Component item count scaled to the disassembled item/UFO's codition

Definition at line 30 of file cp_component.h.

◆ MAX_ASSEMBLIES

#define MAX_ASSEMBLIES   16

Max number of assemblies

Definition at line 28 of file cp_component.h.

◆ MAX_COMP

#define MAX_COMP   32

Max component in an assembly

Definition at line 29 of file cp_component.h.

Function Documentation

◆ COMP_GetComponentsByID()

components_t * COMP_GetComponentsByID ( const char *  id)

Returns components definition by ID.

Parameters
[in]idassemblyId of the component definition.
Returns
Pointer to components_t definition.

Definition at line 145 of file cp_component.cpp.

References components_t::assemblyId, ccs, cgi, ccs_t::components, ERR_DROP, i, ccs_t::numComponents, and Q_streq.

Referenced by US_LoadXML(), and US_StoreUFO().

◆ COMP_ParseComponents()

void COMP_ParseComponents ( const char *  name,
const char **  text 
)