<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://modiki.civfanatics.com/index.php?action=history&amp;feed=atom&amp;title=Player.Cities_%28Civ5_API%29</id>
	<title>Player.Cities (Civ5 API) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://modiki.civfanatics.com/index.php?action=history&amp;feed=atom&amp;title=Player.Cities_%28Civ5_API%29"/>
	<link rel="alternate" type="text/html" href="https://modiki.civfanatics.com/index.php?title=Player.Cities_(Civ5_API)&amp;action=history"/>
	<updated>2026-06-30T21:08:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://modiki.civfanatics.com/index.php?title=Player.Cities_(Civ5_API)&amp;diff=11767&amp;oldid=prev</id>
		<title>DonQuich: Bot update</title>
		<link rel="alternate" type="text/html" href="https://modiki.civfanatics.com/index.php?title=Player.Cities_(Civ5_API)&amp;diff=11767&amp;oldid=prev"/>
		<updated>2012-09-20T07:40:28Z</updated>

		<summary type="html">&lt;p&gt;Bot update&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Civ5 API Beta Banner}}&lt;br /&gt;
&amp;#039;&amp;#039;This page is a part of the [[Lua and UI Reference (Civ5)]].&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{TypeInfos5|Function.png|This function is a member of {{Type5|Player}}.&amp;lt;br/&amp;gt;&lt;br /&gt;
This is an instance method, invoke it with a colon.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Returns all of a player&amp;#039;s cities. Must be used in a for loop because it&amp;#039;s an iterator function (see example)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Usage=&lt;br /&gt;
&amp;lt;code&amp;gt;iterator({{Type5|City}}) Player:Cities&amp;lt;b&amp;gt;(&amp;lt;/b&amp;gt;&amp;lt;b&amp;gt;)&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returned Value&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Iterator over all of a player&amp;#039;s cities&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Examples=&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; class=&amp;quot;civ5-example&amp;quot;&amp;gt;&lt;br /&gt;
for City in Player:Cities() do&lt;br /&gt;
...&lt;br /&gt;
end&lt;br /&gt;
local pPlayer = Players[Game.GetActivePlayer()]&lt;br /&gt;
for pCity in pPlayer:Cities() do&lt;br /&gt;
print(&amp;quot;City ID &amp;quot;,pCity:GetID(),&amp;quot; Population is &amp;quot;,pCity:GetPopulation())&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Source code samples=&lt;br /&gt;
&amp;#039;&amp;#039;Redundant occurences have been removed.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|CityList.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;UI/InGame/CityList.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0100}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for pCity in pPlayer:Cities() do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|GPList.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;UI/InGame/GPList.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0197}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for pCity in player:Cities() do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|TradeLogic.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;UI/InGame/WorldView/TradeLogic.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|1267}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for pCity in g_pUs:Cities() do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|1285}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for pCity in g_pThem:Cities() do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|2463}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for pCity in m_pFrom:Cities() do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|TurnsRemaining.lua (G&amp;amp;K)}}&lt;br /&gt;
:&amp;lt;code&amp;gt;DLC/Expansion/Scenarios/FallOfRomeScenario/TurnsRemaining.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0414}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for pCity in Players[playerID]:Cities() do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|TutorialChecks.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;Tutorial/TutorialChecks.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0257}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for v in player:Cities() do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|2524}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for v in pOtherPlayer:Cities() do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|2750}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for v in pPlayer:Cities() do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|WhosWinningPopup.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;UI/InGame/Popups/WhosWinningPopup.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0192}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for pLoopCity in pPlayer:Cities() do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Civ5 API Footer}}&lt;br /&gt;
[[Category:Civ5 Methods and Functions|Cities]]&lt;br /&gt;
[[Category:Civ5 Cities API|Cities]]&lt;/div&gt;</summary>
		<author><name>DonQuich</name></author>
	</entry>
</feed>