[LUA QUESTION] Loop Through Plots in City

Tryhard Trevor

Chieftain
Joined
Feb 29, 2016
Messages
22
Currently working on a custom Civ. Does anyone have any suggestions on what the best way to get and loop through all the plots in a city?
 
The basic code is

Code:
for i = 0, pCity:GetNumCityPlots()-1, 1 do
	local pPlot = pCity:GetCityIndexPlot(i)
	if (pPlot) then
		-- Do some more tests here
	end
end

If you need finer grained control (city working the plot, etc), see CityView.lua for further details
 
Back
Top Bottom