// defined somewhere
enum class BuildingTypeT {FARM, LUMBERJACK, MINE, SAWMILL, MINT, KITCHEN, FACTORY}
// in a SectorT
BuildBuilding(BuildingTypeT type, WarehouseT warehouse) {
if (BuildingT::CanBuild(type, warehouse) ) {
BuildingT tmp = BuildingT(type,warehouse);
myBuildings.push_back(tmp);
}
}
DoBuildingProduction(WarehouseT w){
freePop = population;
for (auto buildnig: myBuildings) {
if (building.WorkersNeeded() < freePop) {
freePop -= building.WorkersNeeded();
if (building.CanProduce(warehouse)) {
building.Produce(warehouse);
foodBonus += building.FoodBonus();
...
}
}
}