summaryrefslogtreecommitdiffstats
path: root/src/game.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.c')
-rw-r--r--src/game.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/game.c b/src/game.c
index a8ab3e4..0cab8e5 100644
--- a/src/game.c
+++ b/src/game.c
@@ -23,16 +23,19 @@
#include <stdlib.h>
#include <string.h>
#include "game.h"
+#include "level.h"
#include "locale.h"
#include "output.h"
#include "xml.h"
struct db_game {
- char *id;
- int best_name_match;
- int best_desc_match;
- char *name;
- char *desc;
+ char *id;
+ int best_name_match;
+ int best_desc_match;
+ char *name;
+ char *desc;
+ struct db_level *level_head;
+ struct db_level *level_tail;
enum {
DB_GAME_XML_PARSING_NAME,
DB_GAME_XML_PARSING_DESCRIPTION,
@@ -186,7 +189,10 @@ _db_game_xml_levels_el_start(void *pv, const char *name, const char **attr)
return;
}
db_dbg(" id=\"%s\"", id);
- /* TODO */
+ game->level_tail = db_level_new(game->id, id, game->level_tail);
+ if (game->level_head == NULL) {
+ game->level_head = game->level_tail;
+ }
free(id);
db_xml_node_push(p, game, _db_game_xml_invalid_start,
_db_game_xml_level_end, NULL);