1 /* 2 * Seven Kingdoms: Ancient Adversaries 3 * 4 * Copyright 1997,1998 Enlight Software Ltd. 5 * 6 * This program is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation, either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 * 19 */ 20 21 // Filename : OREGIONS.H 22 // Description : Header file of RegionStat 23 24 #ifndef __OREGIONS_H 25 #define __OREGIONS_H 26 27 #ifndef __OFIRMID_H 28 #include <OFIRMID.h> 29 #endif 30 31 //-------- Define constant ---------// 32 33 #define MIN_STAT_REGION_SIZE 100 // only regions with size >= 100 locations are included in the region_stat_array 34 35 #define MAX_REACHABLE_REGION_PER_STAT 10 // maximum reachable regions to be kept in RegionStat 36 37 //------- Define struct RegionPath -------// 38 39 #pragma pack(1) 40 struct RegionPath 41 { 42 uint8_t sea_region_id; // region id. of the sea route 43 uint8_t land_region_stat_id; 44 }; 45 #pragma pack() 46 47 //------- Define class RegionStat --------// 48 49 #pragma pack(1) 50 class RegionStat 51 { 52 public: 53 uint8_t region_id; // sorted in the order of region size 54 55 char nation_is_present_array[MAX_NATION]; 56 char nation_presence_count; 57 58 short firm_type_count_array[MAX_FIRM_TYPE]; 59 short firm_nation_count_array[MAX_NATION]; 60 short camp_nation_count_array[MAX_NATION]; 61 short mine_nation_count_array[MAX_NATION]; 62 short harbor_nation_count_array[MAX_NATION]; 63 short total_firm_count; 64 65 short town_nation_count_array[MAX_NATION]; 66 short base_town_nation_count_array[MAX_NATION]; 67 short independent_town_count; 68 short total_town_count; 69 70 short nation_population_array[MAX_NATION]; 71 short nation_jobless_population_array[MAX_NATION]; 72 73 short unit_nation_count_array[MAX_NATION]; 74 short independent_unit_count; // either rebels or monsters 75 short total_unit_count; 76 77 short site_count; 78 short raw_count; 79 80 RegionPath reachable_region_array[MAX_REACHABLE_REGION_PER_STAT]; 81 char reachable_region_count; 82 83 public: 84 void init(); 85 void update_stat(); 86 }; 87 #pragma pack() 88 89 //--------------------------------------------// 90 91 #endif 92