cell.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #ifndef __CELL__
  2. #define __CELL__
  3. #include <vector>
  4. #include <utility>
  5. #include "building.h"
  6. class cell{
  7. public:
  8. cell(building b): _building(b), _access(0), _air_pollution(0), _water_pollution(0), _soil_pollution(0), _radioactive_pollution(0),
  9. _electricity(0), _water(0), _has_pipe(false), _has_subway(false), _traffic(0), _wind(0), _building_time(b.get_building_time()), _road_direction(0){}
  10. cell(building b, int access, int ecosystem_pollution, bool has_pipe,
  11. bool has_subway): _building(b), _access(access),
  12. _air_pollution(0), _water_pollution(0), _soil_pollution(0), _radioactive_pollution(0),
  13. _electricity(0), _water(0), _has_pipe(has_pipe),
  14. _has_subway(has_subway), _traffic(0), _wind(0){}
  15. cell(): _access(0), _air_pollution(0), _water_pollution(0), _soil_pollution(0), _radioactive_pollution(0), _electricity(0), _water(0),
  16. _has_pipe(false), _has_subway(false), _traffic(0), _wind(0){}
  17. building get_building(){ return _building; }
  18. bool has_needs_met();
  19. int get_access(){ return _access; }
  20. int get_air_pollution(){ return _air_pollution; }
  21. int get_water_pollution(){ return _water_pollution; }
  22. int get_soil_pollution(){ return _soil_pollution; }
  23. int get_radioactive_pollution(){ return _radioactive_pollution; }
  24. int get_water(){ return _water; }
  25. int get_traffic(){ return _traffic; }
  26. int get_electricity(){ return _electricity; }
  27. int get_wind(){ return _wind; }
  28. double get_building_time(){ return _building_time; }
  29. bool has_pipe(){ return _has_pipe; }
  30. bool has_subway(){ return _has_subway; }
  31. int get_direction(){ return _road_direction; }
  32. void set_building(building build){ _building = build; }
  33. void set_access(int access){ _access = access; }
  34. void set_air_pollution(int air_pollution){ _air_pollution = air_pollution; }
  35. void set_water_pollution(int water_pollution){ _water_pollution = water_pollution; }
  36. void set_soil_pollution(int soil_pollution){ _soil_pollution = soil_pollution; }
  37. void set_radioactive_pollution(int radioactive_pollution){
  38. _radioactive_pollution = radioactive_pollution;
  39. }
  40. void set_electricity(int electricity){ _electricity = electricity; }
  41. void set_water(int water){ _water = water; }
  42. void set_pipe(bool has_pipe){ _has_pipe = has_pipe; }
  43. void set_subway(bool has_subway){ _has_subway = has_subway; }
  44. void set_traffic(int traffic){ _traffic = traffic; }
  45. void set_wind(int wind){ _wind = wind; }
  46. void set_building_time(double building_time){ _building_time = building_time; }
  47. void set_employment(int x, int y);
  48. vector<pair<int,int>> get_employment_vector(){ return _employment_vector; }
  49. void delete_employment(int x, int y);
  50. void clear_employment();
  51. std::string color_by_type();
  52. std::string color_by_traffic();
  53. std::string color_by_access();
  54. std::string color_by_water();
  55. std::string color_by_pollution();
  56. std::string color_by_electricity();
  57. std::string color_by_building_time();
  58. std::string clear_color();
  59. private:
  60. building _building;
  61. vector<pair<int, int>> _employment_vector;
  62. int _access;
  63. int _air_pollution;
  64. int _water_pollution;
  65. int _soil_pollution;
  66. int _radioactive_pollution;
  67. int _electricity;
  68. int _water;
  69. bool _has_pipe;
  70. bool _has_subway;
  71. int _traffic;
  72. int _wind;
  73. double _building_time;
  74. //Only one-way roads
  75. int _road_direction;
  76. };
  77. #endif