Player.GetNumResourceAvailable (Civ5 API)

From Civilization Modding Wiki
Jump to: navigation, search

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


Function.png This function is a member of Player.

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


Usage

int Player:GetNumResourceAvailable(ResourceType resource, bool includeImport)


Returned Value

No description available.

Parameters

resource: No description available.
includeImport: No description available.


Source code samples

Redundant occurences have been removed.

DiploRelationships.lua

UI/InGame/Popups/DiploRelationships.lua
0337
local iResourceCount = Players[iPlayer]:GetNumResourceAvailable( i, false );


GenericWorldAnchor.lua

UI/InGame/GenericWorldAnchor.lua
0159
if (pPlayer:GetNumResourceAvailable(iResource) == 0) then


ResourceList.lua

UI/InGame/ResourceList.lua
0092
iAvailable = pPlayer:GetNumResourceAvailable( iResource, true );


TopPanel.lua

UI/InGame/TopPanel.lua
0171
iNumAvailable = pPlayer:GetNumResourceAvailable(iResourceLoop, true);


TradeLogic.lua

UI/InGame/WorldView/TradeLogic.lua
1368
iResourceCount = g_pUs:GetNumResourceAvailable( resType, false );
1435
iResourceCount = g_pThem:GetNumResourceAvailable( resType, false );
2226
if (iAmount > Players[g_iUs]:GetNumResourceAvailable(resourceId, false)) then
2227
iAmount = Players[g_iUs]:GetNumResourceAvailable(resourceId, false);
2231
if (iAmount > Players[g_iThem]:GetNumResourceAvailable(resourceId, false)) then
2232
iAmount = Players[g_iThem]:GetNumResourceAvailable(resourceId, false);
2331
if (iNumResource > pPlayer:GetNumResourceAvailable(iResourceID, false)) then
2332
iNumResource = pPlayer:GetNumResourceAvailable(iResourceID, false);


TutorialChecks.lua

Tutorial/TutorialChecks.lua
2792
local amount = pPlayer:GetNumResourceAvailable(iResourceLoop, false);
2816
if (pOtherPlayer:GetNumResourceAvailable(tradeableResource, true) == 0) then
2821
if(pOtherPlayer:GetNumResourceAvailable(tradeableResource, false) > 0) then


UnitPanel.lua

UI/InGame/WorldView/UnitPanel.lua
0994
if (iNumResourceNeededToUpgrade > 0 and iNumResourceNeededToUpgrade > pActivePlayer:GetNumResourceAvailable(iResourceLoop)) 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.