City.IsCanPurchase (Civ5 API)

From Civilization Modding Wiki
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

This page is a part of the Lua and UI Reference (Civ5).


Function.png This function is a member of City.

This is an instance method, invoke it with a colon.


Usage

bool City:IsCanPurchase(UnitType unitType, int buildingType, int projectType, int projectID, int projectID = nil, YieldType yield = nil)


Returned Value

No description available.

Parameters

unitType: No description available.
buildingType: No description available.
projectType: No description available.
projectID: No description available.
projectID: No description available.
yield: No description available.


Source code samples

ProductionPopup.lua

UI/InGame/Popups/ProductionPopup.lua
0288
if city:IsCanPurchase(true, unitID, -1, -1) then
0292
if (not city:IsCanPurchase(false, unitID, -1, -1)) then
0345
if city:IsCanPurchase(true, -1, -1, projectID) then
0387
if city:IsCanPurchase(true, -1, buildingID, -1) then
0395
if (not city:IsCanPurchase(false, -1, buildingID, -1)) then


ProductionPopup.lua (G&K)

DLC/Expansion/UI/InGame/Popups/ProductionPopup.lua
0111
if (city:IsCanPurchase(true, true, iData, -1, -1, eYield)) then
0116
if (city:IsCanPurchase(true, true, -1, iData, -1, eYield)) then
0120
if (city:IsCanPurchase(true, true, -1, -1, iData, eYield)) then
0344
if city:IsCanPurchase(false, false, unitID, -1, -1, YieldTypes.YIELD_GOLD) then
0348
if (not city:IsCanPurchase(true, true, unitID, -1, -1, YieldTypes.YIELD_GOLD)) then
0356
if city:IsCanPurchase(false, false, unitID, -1, -1, YieldTypes.YIELD_FAITH) then
0360
if (not city:IsCanPurchase(true, true, unitID, -1, -1, YieldTypes.YIELD_FAITH)) then
0414
if city:IsCanPurchase(false, false, -1, -1, projectID, YieldTypes.YIELD_GOLD) then
0456
if city:IsCanPurchase(false, false, -1, buildingID, -1, YieldTypes.YIELD_GOLD) then
0464
if (not city:IsCanPurchase(true, true, -1, buildingID, -1, YieldTypes.YIELD_GOLD)) then
0475
elseif city:IsCanPurchase(false, false, -1, buildingID, -1, YieldTypes.YIELD_FAITH) then
0483
if (not city:IsCanPurchase(true, true, -1, buildingID, -1, YieldTypes.YIELD_FAITH)) then



The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.