-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathResidentialSystem.h
29 lines (23 loc) · 1.01 KB
/
ResidentialSystem.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// ResidentialSystem.h
// Complete implementation for the residential zone management system
#ifndef RESIDENTIAL_SYSTEM_H
#define RESIDENTIAL_SYSTEM_H
#include <vector>
#include "Cell.h"
class ResidentialSystem
{
public:
// Core functions for residential zone management
static void update(std::vector<std::vector<Cell>> &grid);
static int getTotalPopulation(const std::vector<std::vector<Cell>> &grid);
static int getAvailableWorkers(const std::vector<std::vector<Cell>> &grid);
// Growth condition checking
static bool canGrow(const std::vector<std::vector<Cell>> &grid, int x, int y);
// Utility functions for zone management
static int countAdjacentPopulation(const std::vector<std::vector<Cell>> &grid, int x, int y, int minPop);
static bool isPowered(const std::vector<std::vector<Cell>> &grid, int x, int y);
// Constants for growth rules
static const int MAX_POPULATION = 5;
static const int POWER_RADIUS = 1;
};
#endif // RESIDENTIAL_SYSTEM_H