tilelist = list of tiles, best method would be take all map, but you know you shouldn't do that right
Code: Select all
tilelist.Valuate(AITile.GetTownAuthority);
tilelist.KeepValue(town_id);
tilelist.Valuate(AITile.IsBuildable);
tilelist.RemoveValue(1);
tilelist.Valuate(AITile.IsWaterTile);
tilelist.RemoveValue(1);
tilelist.Valuate(AIRoad.IsRoadTile);
tilelist.RemoveValue(1);
tilelist.Valuate(AITile.GetOwner);
tilelist.KeepValue(-1);
tilelist.Valuate(AIIndustry.GetIndustryID);
tilelist.KeepValue(65535);
It will remain approximative (but close to reality), as any house more than 1 tile will count for x houses (a 4 tile house = 4 houses). And highly depend on the town size (as GetTownAuthority depend on it if i remember well), size of closest town (i'm not sure when authority overlap what answer you get)and of course how you catch tiles at first to fill the tilelist (too few tiles you may miss houses)
(in case you miss it, your AITile.IsIndustry solve was given within it, as i removed industry tiles within the town, in case a bank exist)