1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- #ifndef __CELL__
- #define __CELL__
- #include <vector>
- #include <utility>
- #include "building.h"
- class cell{
-
- public:
- cell(building b): _building(b), _access(0), _air_pollution(0), _water_pollution(0), _soil_pollution(0), _radioactive_pollution(0),
- _electricity(0), _water(0), _has_pipe(false), _has_subway(false), _traffic(0), _wind(0), _building_time(b.get_building_time()), _road_direction(0){}
- cell(building b, int access, int ecosystem_pollution, bool has_pipe,
- bool has_subway): _building(b), _access(access),
- _air_pollution(0), _water_pollution(0), _soil_pollution(0), _radioactive_pollution(0),
- _electricity(0), _water(0), _has_pipe(has_pipe),
- _has_subway(has_subway), _traffic(0), _wind(0){}
- cell(): _access(0), _air_pollution(0), _water_pollution(0), _soil_pollution(0), _radioactive_pollution(0), _electricity(0), _water(0),
- _has_pipe(false), _has_subway(false), _traffic(0), _wind(0){}
- building get_building(){ return _building; }
- bool has_needs_met();
- int get_access(){ return _access; }
- int get_air_pollution(){ return _air_pollution; }
- int get_water_pollution(){ return _water_pollution; }
- int get_soil_pollution(){ return _soil_pollution; }
- int get_radioactive_pollution(){ return _radioactive_pollution; }
- int get_water(){ return _water; }
- int get_traffic(){ return _traffic; }
- int get_electricity(){ return _electricity; }
- int get_wind(){ return _wind; }
- double get_building_time(){ return _building_time; }
- bool has_pipe(){ return _has_pipe; }
- bool has_subway(){ return _has_subway; }
- int get_direction(){ return _road_direction; }
- void set_building(building build){ _building = build; }
- void set_access(int access){ _access = access; }
- void set_air_pollution(int air_pollution){ _air_pollution = air_pollution; }
- void set_water_pollution(int water_pollution){ _water_pollution = water_pollution; }
- void set_soil_pollution(int soil_pollution){ _soil_pollution = soil_pollution; }
- void set_radioactive_pollution(int radioactive_pollution){
- _radioactive_pollution = radioactive_pollution;
- }
- void set_electricity(int electricity){ _electricity = electricity; }
- void set_water(int water){ _water = water; }
- void set_pipe(bool has_pipe){ _has_pipe = has_pipe; }
- void set_subway(bool has_subway){ _has_subway = has_subway; }
- void set_traffic(int traffic){ _traffic = traffic; }
- void set_wind(int wind){ _wind = wind; }
- void set_building_time(double building_time){ _building_time = building_time; }
- void set_employment(int x, int y);
- vector<pair<int,int>> get_employment_vector(){ return _employment_vector; }
- void delete_employment(int x, int y);
- void clear_employment();
- std::string color_by_type();
- std::string color_by_traffic();
- std::string color_by_access();
- std::string color_by_water();
- std::string color_by_pollution();
- std::string color_by_electricity();
- std::string color_by_building_time();
-
- std::string clear_color();
-
- private:
- building _building;
- vector<pair<int, int>> _employment_vector;
- int _access;
-
- int _air_pollution;
- int _water_pollution;
- int _soil_pollution;
- int _radioactive_pollution;
- int _electricity;
- int _water;
- bool _has_pipe;
- bool _has_subway;
- int _traffic;
- int _wind;
- double _building_time;
-
- //Only one-way roads
- int _road_direction;
- };
- #endif
|