/* army.h
 *
 * For all your army stuff.
 *
 * (c) 2006, Joseph Curtis
 */


#define TROOP_WIDTH 32 /* 26 width of the troop cells */
#define TROOP_HEIGHT 28 /* 22 height of the troop cells */
#define ARMY_WIDTH 16 /* width of the army graphic in troop cells */

#define MAX_ARMY_IN_GROUP 10 /* Pretty sure this is the limit.  For
			       the ease of use I will make this a
			       static array.  Even though each group
			       will have a larger memory footprint. */

#define MAX_ARMY_NAME 20
#define MAX_TYPE_NAME 20

/* Army types */
#define GIANT_WARRIORS 0
#define HEAVY_INFANTRY 1
#define LIGHT_INFANTRY 2
#define DWARVEN_WARRIORS 3
#define CAVALRY 4
#define NAVY 5
#define ARCHER 6
#define WOLF_RIDERS 7
#define PEGASI 8
#define GRYPHONS 9
#define WIZARDS 10
#define GHOSTS 11
#define DRAGONS 12
#define DEMONS 13
#define UNDEAD 14
#define HERO 15

/* etc. */

/* selection option defines */
#define SELECT_NONE 0
#define SELECT_ONE 1
#define SELECT_GROUP 2

/**
 * Different troops take different moves on different terrain, I
 * think.
 */
struct terrain_moves {
  char road;
  char grass;
  char forest;
  char swamp;
  char hills;
  char mountains;
  char water;
  char town;
};



/**
 * Army types 
 */
struct army_type {
  char t; /* type #define */
  char name[MAX_TYPE_NAME];
  char max_moves;
  struct terrain_moves m;   /* moves taken on different terrain */
  char strength;
  //  int image;
  /* Indexed from left to right between 0 and 15.  moduli of this and
    ARMY_WIDTH are for the different teams. I think this is superceded
    and made redundant by having the type #define index the image. */
  
};

/**
 * Represents an individual army of one type.
 */
struct army {
  struct army_type type;
  char name[MAX_ARMY_NAME];
  char moves_left;
  short int x, y; /* Position of army.  I think this should be in
		     army_group :-O */
  char team; /* as #defined in player.h */
};

/**
 * Army group.  All armies will be in a group no matter what.  Even if
 * there is only one army in it.
 */
struct army_group {
  char num_armies;   /* obviously a minimum of 1 */
  char on_top;       /* which army is currently on top of the pile */
  char selected;     /* if the group is selected, the on_top is
			selected or nothing is selected. see defines */
  struct army a[MAX_ARMY_IN_GROUP];
};


/**
 * Print out info about an army.
 */
void print_army(struct army a);



extern const struct army_type light_infantry;
extern const struct army_type hero;

