OREGIONS.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. // Filename : OREGIONS.H
  21. // Description : Header file of RegionStat
  22. #ifndef __OREGIONS_H
  23. #define __OREGIONS_H
  24. #ifndef __OFIRMID_H
  25. #include <OFIRMID.h>
  26. #endif
  27. //-------- Define constant ---------//
  28. #define MIN_STAT_REGION_SIZE 100 // only regions with size >= 100 locations are included in the region_stat_array
  29. #define MAX_REACHABLE_REGION_PER_STAT 10 // maximum reachable regions to be kept in RegionStat
  30. //------- Define struct RegionPath -------//
  31. #pragma pack(1)
  32. struct RegionPath
  33. {
  34. BYTE sea_region_id; // region id. of the sea route
  35. BYTE land_region_stat_id;
  36. };
  37. #pragma pack()
  38. //------- Define class RegionStat --------//
  39. #pragma pack(1)
  40. class RegionStat
  41. {
  42. public:
  43. BYTE region_id; // sorted in the order of region size
  44. char nation_is_present_array[MAX_NATION];
  45. char nation_presence_count;
  46. short firm_type_count_array[MAX_FIRM_TYPE];
  47. short firm_nation_count_array[MAX_NATION];
  48. short camp_nation_count_array[MAX_NATION];
  49. short mine_nation_count_array[MAX_NATION];
  50. short harbor_nation_count_array[MAX_NATION];
  51. short total_firm_count;
  52. short town_nation_count_array[MAX_NATION];
  53. short base_town_nation_count_array[MAX_NATION];
  54. short independent_town_count;
  55. short total_town_count;
  56. short nation_population_array[MAX_NATION];
  57. short nation_jobless_population_array[MAX_NATION];
  58. short unit_nation_count_array[MAX_NATION];
  59. short independent_unit_count; // either rebels or monsters
  60. short total_unit_count;
  61. short site_count;
  62. short raw_count;
  63. RegionPath reachable_region_array[MAX_REACHABLE_REGION_PER_STAT];
  64. char reachable_region_count;
  65. public:
  66. void init();
  67. void update_stat();
  68. };
  69. #pragma pack()
  70. //--------------------------------------------//
  71. #endif