20#include "damagetype.h"
22#define XML_START_ID "Start"
27typedef struct ndata_start_s {
65 node = doc->xmlChildrenNode;
67 ERR( _(
"Malformed '%s' file: missing root element '%s'"), START_DATA_PATH,
XML_START_ID );
71 node = node->xmlChildrenNode;
73 ERR( _(
"Malformed '%s' file: does not contain elements"), START_DATA_PATH );
81 if (xml_isNode(node,
"player")) {
82 xmlNodePtr cur = node->children;
92 if (xml_isNode(cur,
"ship")) {
97 else if (xml_isNode(cur,
"system")) {
98 xmlNodePtr tmp = cur->children;
106 WARN(_(
"'%s' has unknown system node '%s'."), START_DATA_PATH, tmp->name);
107 }
while (xml_nextNode(tmp));
110 WARN(_(
"'%s' has unknown player node '%s'."), START_DATA_PATH, cur->name);
111 }
while (xml_nextNode(cur));
115 if (xml_isNode(node,
"date")) {
116 int cycles, periods, seconds;
117 xmlr_attr_int( node,
"scu", cycles );
118 xmlr_attr_int( node,
"stp", periods );
119 xmlr_attr_int( node,
"stu", seconds );
131 WARN(_(
"'%s' has unknown node '%s'."), START_DATA_PATH, node->name);
132 }
while (xml_nextNode(node));
138#define MELEMENT(o,s) \
139 if (o) WARN(_("Module start data missing/invalid '%s' element"), s)
147 MELEMENT( !date_set,
"date" );
Header file with generic functions and naev-specifics.
ntime_t ntime_create(int scu, int stp, int stu)
Creates a time structure.
xmlDocPtr xml_parsePhysFS(const char *filename)
Analogous to xmlParseMemory/xmlParseFile.
static ndata_start_t start_data
const char * start_acquired(void)
Gets the module's starting ship was acquired.
const char * start_event(void)
Gets the starting event of the player.
void start_cleanup(void)
Cleans up after the module start data.
const char * start_local_map_default(void)
Gets the default local map.
int start_load(void)
Loads the module start data.
const char * start_mission(void)
Gets the starting mission of the player.
void start_position(double *x, double *y)
Gets the starting position of the player.
const char * start_chapter(void)
Gets the player's starting chapter.
const char * start_name(void)
Gets the module name.
const char * start_dtype_default(void)
Gets the default damage type.
const char * start_ship(void)
Gets the module player starting ship.
ntime_t start_date(void)
Gets the starting date.
const char * start_spob_lua_default(void)
Gets the default spob Lua file.
const char * start_shipname(void)
Gets the module's starting ship's name.
const char * start_gui(void)
Gets the module's starting ship was acquired.
const char * start_system(void)
Gets the starting system name.
unsigned int start_credits(void)
Gets the player's starting credits.
The start data structure.