function MainClass::IsTownGrowing() {
local townList = GSTownList();
for (local town = townList.Begin(); !townList.IsEnd(); town = townList.Next()) {
local cargoList = GSCargoList();
cargoList.Sort(GSList.SORT_BY_ITEM, GSList.SORT_ASCENDING);
local cargoRequired = GSList();
for (local cargo_type = cargoList.Begin(); !cargoList.IsEnd(); cargo_type = cargoList.Next()) {
local town_effect = GSCargo.GetTownEffect(cargo_type);
local class_name = "";
for (local cc = 0; cc <= 15; cc++) {
local cargo_class = 1 << cc;
if (GSCargo.HasCargoClass(cargo_type, cargo_class)) {
if (class_name != "") class_name += ", ";
switch(cargo_class) {
case GSCargo.CC_PASSENGERS: class_name += "CC_PASSENGERS"; break;
case GSCargo.CC_MAIL: class_name += "CC_MAIL"; break;
case GSCargo.CC_EXPRESS: class_name += "CC_EXPRESS"; break;
case GSCargo.CC_ARMOURED: class_name += "CC_ARMOURED"; break;
case GSCargo.CC_BULK: class_name += "CC_BULK"; break;
case GSCargo.CC_PIECE_GOODS: class_name += "CC_PIECE_GOODS"; break;
case GSCargo.CC_LIQUID: class_name += "CC_LIQUID"; break;
case GSCargo.CC_REFRIGERATED: class_name += "CC_REFRIGERATED"; break;
case GSCargo.CC_HAZARDOUS: class_name += "CC_HAZARDOUS"; break;
case GSCargo.CC_COVERED: class_name += "CC_COVERED"; break;
case 1 << 15: class_name += "CC_SPECIAL"; break;
default: class_name += "unknown (" + cargo_class + ")"; break;
}
}
}
GSLog.Info("Cargo " + cargo_type + ": " + GSCargo.GetCargoLabel(cargo_type) + (class_name == "" ? "" : "; CargoClass = " + class_name));
if (town_effect != GSCargo.TE_NONE) {
local effect_name;
switch(town_effect) {
case GSCargo.TE_PASSENGERS: effect_name = "TE_PASSENGERS"; break;
case GSCargo.TE_MAIL: effect_name = "TE_MAIL"; break;
case GSCargo.TE_GOODS: effect_name = "TE_GOODS"; break;
case GSCargo.TE_WATER: effect_name = "TE_WATER"; break;
case GSCargo.TE_FOOD: effect_name = "TE_FOOD"; break;
}
GSLog.Info(" - Effect of " + GSCargo.GetCargoLabel(cargo_type) + " in " + GSTown.GetName(town) + " is " + effect_name);
local cargo_goal = GSTown.GetCargoGoal(town, town_effect);
if (cargo_goal != 0) {
GSLog.Info(" - An amount of " + cargo_goal + " " + GSCargo.GetCargoLabel(cargo_type) + " is required to grow " + GSTown.GetName(town));
cargoRequired.AddItem(cargo_type, cargo_goal);
}
}
}
GSLog.Info(" ");
}
}