<?xml version="1.0" encoding="utf-8"?>
<s1 title="Building"><p>Building objects can reference details about the buildings currently built or still in progress in your cities. </p>
<p>See also: <jump href="/wiki/BuildingTypes">Building Types</jump><br/>
 See also: <jump href="/wiki/BuildingFunctions">Building Functions</jump> </p>
<p><strong>These objects can be referenced as:</strong> </p>
<ul><li><p><em>m_city.cityManager.buildings[x].property <strong>or</strong> city.buildings[x].property</em> </p>
</li>
<li><p><em>m_city.cityManager.function.property <strong>or</strong> city.function.property</em>  </p>
</li>
</ul>
<p>When referencing these objects via the Building object, the <em>[x]</em> can be any number from 0-73. Each city has up to 74 possible buildings on it, 32 spaces inside plus walls and town hall, and 40 spaces outside. The first building you start with is city.building[73] (The Town Hall) and each building you construct after that takes the next available number counting back to 0... (72,71,70,69,etc) </p>
<p>When referencing these objects via a function, please see <jump href="/wiki/BuildingFunctions">BuildingFunctions</jump>. For example, city.getBuildingByTypeId(25).level would tell you the level of the academy. </p>
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p><strong>Property </strong> </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p><strong>Type</strong> </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p><strong>Description </strong> </p>
</td></tr><tr><td><p>name </p>
</td><td><p>String </p>
</td><td><p>The name of the type of building (&quot;Forge&quot;,&quot;Stable&quot;,&quot;Inn&quot;,etc.) </p>
</td></tr><tr><td><p>positionId </p>
</td><td><p>int </p>
</td><td><p>The number indicating the position id of the building. Town Hall is in position -1. See images below for each position id. </p>
</td></tr><tr><td><p>status </p>
</td><td><p>int </p>
</td><td><p>The active status of the building. 0 = complete, 1 = upgrading, 2 = demolishing. </p>
</td></tr><tr><td><p>endTime </p>
</td><td><p>int </p>
</td><td><p>Returns the time in UNIX timestamp format indicating when building will be finished upgrading or demolishing. Returns 0 if not being worked on. </p>
</td></tr><tr><td><p>startTime </p>
</td><td><p>int </p>
</td><td><p>Returns the time in UNIX timestamp format indicating when building began upgrading or demolishing. Returns 0 if not being worked on. </p>
</td></tr><tr><td><p>typeId </p>
</td><td><p>int </p>
</td><td><p>Returns the numerical code for the <jump href="/wiki/BuildingTypes">BuildingTypes</jump> </p>
</td></tr><tr><td><p>level </p>
</td><td><p>int </p>
</td><td><p>Returns the level of the building. </p>
</td></tr><tr><td><p>length </p>
</td><td><p>int </p>
</td><td><p>Returns the total number of buildings in the city. </p>
</td></tr></table><p><strong> Position IDs for Building </strong> </p>
<p>[Image:http://i.imgur.com/IRtmGbf.png]</img> [Image:http://i.imgur.com/r1Voz7t.png]</img> </p>
<p></p>

<br/>------------------------------------------------------------------------------<br/>
<p> <jump href="/wiki/ScriptObjects">ScriptObjects</jump> </p>
</s1>