OFIRMA.h 2.1 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 : OFIRMA.H
  21. //Description : Object Firm Array
  22. #ifndef __OFIRMA_H
  23. #define __OFIRMA_H
  24. #ifndef __ODYNARRB_H
  25. #include <ODYNARRB.h>
  26. #endif
  27. //--------- Define class FirmArray ----------//
  28. class Firm;
  29. class FirmArray : public DynArrayB
  30. {
  31. public:
  32. int selected_recno; // the firm current being selected
  33. private:
  34. int process_recno;
  35. public:
  36. FirmArray();
  37. ~FirmArray();
  38. void init();
  39. void deinit();
  40. int build_firm(int xLoc, int yLoc, int nationRecno, int firmId, char* buildCode=NULL, short builderRecno=0);
  41. int create_firm(int);
  42. void del_firm(int);
  43. int firm_class_size(int);
  44. int process();
  45. void next_day();
  46. void next_month();
  47. void next_year();
  48. void draw_dot();
  49. //### begin alex 12/9 ###//
  50. void draw_profile();
  51. //#### end alex 12/9 ####//
  52. void skip(int);
  53. int write_file(File*);
  54. int read_file(File*);
  55. #ifdef DEBUG
  56. Firm* operator()(); // reference to current Firm record
  57. Firm* operator[](int recNo);
  58. #else
  59. Firm* operator()() { return (Firm*) get_ptr(); }
  60. Firm* operator[](int recNo) { return (Firm*) get_ptr(recNo); }
  61. #endif
  62. int is_deleted(int recNo) // whether the item is deleted or not
  63. { return get_ptr(recNo) == NULL; }
  64. };
  65. //---------------------------------------------//
  66. class MLink;
  67. extern MLink firm_mlink;
  68. extern FirmArray firm_array;
  69. //---------------------------------------------//
  70. #endif