Plot.CalculateYield (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 Plot.

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


Usage

int Plot:CalculateYield(YieldType index, bool display)


Returned Value

No description available.

Parameters

index: No description available.
display: No description available.


Source code samples

Redundant occurences have been removed.

GenericWorldAnchor.lua

UI/InGame/GenericWorldAnchor.lua
0268
iYieldChange = iYieldChange - pPlot:CalculateYield(iYield);


PlotMouseoverInclude.lua

UI/InGame/PlotMouseoverInclude.lua
0384
local iNumFood = plot:CalculateYield(0, true);
0390
local iNumProduction = plot:CalculateYield(1, true);
0396
local iNumGold = plot:CalculateYield(2, true);
0402
local iNumScience = plot:CalculateYield(3, true);


PlotMouseoverInclude.lua (G&K)

DLC/Expansion/UI/InGame/PlotMouseoverInclude.lua
0422
local iNumCulture = plot:CalculateYield(4, true);
0428
local iNumFaith = plot:CalculateYield(5, true);


YieldIconManager.lua

UI/InGame/YieldIconManager.lua
0218
local iFood       = plot:CalculateYield( 0, true );-- + math.random( 0, 13 );
0219
local iProduction = plot:CalculateYield( 1, true );-- + math.random( 0, 13 );
0220
local iGold       = plot:CalculateYield( 2, true );-- + math.random( 0, 13 );
0221
local iScience    = plot:CalculateYield( 3, true );-- + math.random( 0, 13 );


YieldIconManager.lua (G&K)

DLC/Expansion/UI/InGame/YieldIconManager.lua
0235
local iFood       = plot:CalculateYield( 0, true );
0236
local iProduction = plot:CalculateYield( 1, true );
0237
local iGold       = plot:CalculateYield( 2, true );
0238
local iScience    = plot:CalculateYield( 3, true );
0239
local iCulture    = plot:CalculateYield( 4, true );
0240
local iFaith      = plot:CalculateYield( 5, true );



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.