/*******************************************************************************
* nation.H *
* - Definitions of a nation in the game game part *
* *
* FREE SPACE COLONISATION *
* Copyright (C) 2002 Paul Mueller <pmtech@swissonline.ch> *
* *
* 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 Library 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. *
*******************************************************************************/
#ifndef _FSC_NATION_H_
#define _FSC_NATION_H_
/*******************************************************************************
* INCLUDES *
*******************************************************************************/
#include "fscshare.h" /* maximum values FSC_* */
#include "rules.h" /* definition RULES_* */
/*******************************************************************************
* DEFINES *
*******************************************************************************/
#define NATION_POLPARTY_MAX 10
/*******************************************************************************
* TYPEDEFS *
*******************************************************************************/
typedef enum {
PI_IT_TAXES = 0, /* int taxes; */
PI_IT_TRADE = 1, /* int trade; */
PI_IT_TRIBUTE = 2, /* int tributeincome; */
PI_IT_TREASURY = 3, /* int treasury --> Money the nation owns */
PI_IT_TOTAL = 4, /* int totalincome; */
PI_IT_MAX = 5
} PI_INCOME_TYPE;
typedef enum {
PI_EXP_MILITARY = 0, /* int exp_military; */
PI_EXP_SOCIAL = 1, /* int exp_social; */
PI_EXP_RESEARCH = 2, /* int exp_research; */
PI_EXP_MAINTENANCE = 3, /* int exp_maintenance; */
PI_EXP_LEASES = 4, /* int exp_leases; */
PI_EXP_GIA = 5, /* int exp_GIA; */
PI_EXP_ESPIONAGE = 6, /* int exp_espionage; */
PI_EXP_DESTABILIZE = 7, /* int exp_destabilization; */
PI_EXP_TRIBUTEPAY = 8, /* int exp_tributepay; */
PI_EXP_TOTAL = 9, /* int exp_total; */
PI_EXP_MAX = 10
} PI_EXPENSES_TYPE;
/*******************************************************************************
* TYPEDEFS *
*******************************************************************************/
typedef struct {
int invested; /* # bulbs already invested in research */
int cost; /* # bulbs needed for this tech , for display, too */
int actual; /* advance being researched in */
char turns; /* Number of turns needed for actual of advance */
unsigned char advancebits[32]; /* Bit set: Researched */
} NATION_RESEARCH;
typedef struct {
char name[FSC_NAMELEN_MAX + 1]; /* Name of this nation */
char leader_name[FSC_NAMELEN_MAX + 1]; /* Name of nations leader */
char leader_no; /* Backlink to the nations leader. For ai_control */
/* -1: Human, >= 0 ai_control */
char ai_control; /* nation_no ==> leader_no */
char government; /* Id of government */
int map_pos; /* In case no home star is at start-position */
/* or there is no 'homestar' at all */
int home_planet; /* Used for start position, influence and so on */
/* --------------- Save actual unit for every nation ------------------ */
int act_unit; /* The number of the actual chosen unit */
/* --------------- Central store for different yields ----------------- */
int store[YIELD_PROD_MAX];
/* ------------ Additional data needed for gameplay ------------------- */
char ranges[RULES_RANGE_MAX]; /* Range in tiles for the different ranges: */
/* _SHORT, _MIDDLE, _LONG, _INFLUENCE */
/* --------- Global bonuses in percent (maximum 250 % per bonus) -------- */
short int bonuses[YIELD_MAX + 1];
/* ----------- Technology ------------------------ */
NATION_RESEARCH research;
/* ---------- Senate (not supported yet) ------------------------------ */
char polparty; /* Basic political party */
char senate[NATION_POLPARTY_MAX + 1]; /* How many of each party are in senate? */
char dipl[FSC_MAJORRACES_MAX + 1]; /* Known aliens: Have contact */
} NATION;
/*******************************************************************************
* CODE *
*******************************************************************************/
/* ===================== INIT FUNCTIONS ================= */
void nationInit(char nation_no, int map_pos, int home_planet);
void nationRemove(char nation_no);
/* ===================== INFORMATION FUNCTIONS ========== */
NATION *nationGet(char nation_no);
int nationCount(void);
void nationGetFinancialInfo(char nation_no, int *income, int *expenses);
int nationGetBonus(char nation_no, int which);
/* =================== UNIT FUNCTIONS =================== */
int nationUnitCreate(char unit_type, int ability, char nation_no, int pos, char cargo_load);
/* ==================== Additional functions ============ */
void nationEndTurnUpdate(char nation_no, int *values);
char *nationGetName(char nation_no);
/* =================== Load and save data of nation ===== */
char *nationGetLoadSaveInfo(int *recsize, int *numrec, int save);
#endif /* _FSC_NATION_H_ */