/*
   spacemaze - Fly a space ship through a maze and collect all the items.
   Copyright (C) 2000, 2001, 2002 John Ericson

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

   2002-06-18 High / John Ericson john.ericson@home.se
*/

#ifndef CAMPAIGN_HEADER
#define CAMPAIGN_HEADER

#include <stdio.h>
#include <stdarg.h> /* We need va_list */
#include <stdlib.h> /* We need strtoi */
#include <string.h>
#include <math.h>

#include <libxml/parser.h>
#include <libxml/parserInternals.h>

#include "bool.h"
#include "defines.h"
#include "trim.h"
#include "sprite.h"

typedef enum {
   CAMPAIGN_START        = 0,       /* 0  */
   CAMPAIGN_CAMPAIGN     = 1 << 0,  /* 1  */
   CAMPAIGN_INFO         = 1 << 1,  /* 2  */
   CAMPAIGN_NAME         = 1 << 3,  /* 4  */
   CAMPAIGN_AUTHOR       = 1 << 4,  /* 8  */
   CAMPAIGN_DESCRIPTION  = 1 << 5,  /* 16 */
   CAMPAIGN_GAMETYPE     = 1 << 6,  /* .. */
   CAMPAIGN_LEVELS       = 1 << 7,
   CAMPAIGN_LEVELFILE    = 1 << 8,
} campaign_state_s;


typedef struct {
   char filename[512];
} campaign_level_s;

typedef struct {
   char name[255];
   int maxplayers;
   char version[32];
   int numlevels;
   campaign_level_s levels[MAXLEVELSINCAMPAIGN];
} campaign_s;

int LoadCampaign(campaign_s *campaign, const char *filename);


#endif /* CAMPAIGN_HEADER */