UFO: Alien Invasion
cp_component.cpp File Reference

Aircraft and item components. More...

#include "../../cl_shared.h"
#include "../../../shared/parse.h"
#include "cp_campaign.h"
Include dependency graph for cp_component.cpp:

Go to the source code of this file.

Data Structures

struct  component_type_data_t
 

Functions

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...
 
components_tCOMP_GetComponentsByID (const char *id)
 Returns components definition by ID. More...
 

Variables

static const value_t components_type_vals []
 

Detailed Description

Aircraft and item components.

Definition in file cp_component.cpp.

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 
)

Variable Documentation

◆ components_type_vals

const value_t components_type_vals[]
static
Initial value:
= {
{"id", V_STRING, offsetof(component_type_data_t, id), 0},
{"amount", V_STRING, offsetof(component_type_data_t, amount), 0},
{"numbercrash", V_STRING, offsetof(component_type_data_t, numbercrash), 0},
{nullptr, V_NULL, 0, 0}
}
@ V_NULL
Definition: scripts.h:49
@ V_STRING
Definition: scripts.h:58

components type values

Definition at line 37 of file cp_component.cpp.

Referenced by COMP_ParseComponents().