ResourceType (Civ5 Type)

From Civilization Modding Wiki
Jump to navigationJump to search

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


ID.png The ResourceType pseudo-type is actually a regular integer. Pseudo-types do not exist in Lua, they only serve a documentation purpose on the wiki!
  • DB.png Integers labeled as ResourceType corresponds to the ID column of the Resources XML table.


XML: the Resources table

Here are the ID and Type columns found in this table.

ID Type
0 RESOURCE_IRON
1 RESOURCE_HORSE
2 RESOURCE_COAL
3 RESOURCE_OIL
4 RESOURCE_ALUMINUM
5 RESOURCE_URANIUM
6 RESOURCE_WHEAT
7 RESOURCE_COW
8 RESOURCE_SHEEP
9 RESOURCE_DEER
10 RESOURCE_BANANA
11 RESOURCE_FISH
12 RESOURCE_STONE
13 RESOURCE_WHALE
14 RESOURCE_PEARLS
15 RESOURCE_GOLD
16 RESOURCE_SILVER
17 RESOURCE_GEMS
18 RESOURCE_MARBLE
19 RESOURCE_IVORY
20 RESOURCE_FUR
21 RESOURCE_DYE
22 RESOURCE_SPICES
23 RESOURCE_SILK
24 RESOURCE_SUGAR
25 RESOURCE_COTTON
26 RESOURCE_WINE
27 RESOURCE_INCENSE
28 RESOURCE_JEWELRY
29 RESOURCE_PORCELAIN
30 RESOURCE_COPPER
31 RESOURCE_SALT
32 RESOURCE_CRAB
33 RESOURCE_TRUFFLES
34 RESOURCE_CITRUS


Examples

Used by

int, int, int GridToWorld(ResourceType gridX, int gridY)
ResourceType, PlayerID ToGridFromHex(float i, float j)
int Area:GetNumResources(ResourceType resource)
ResourceType AssignStartingPlots:AssignLuxuryToRegion(PlayerID region_number)
unknown, int, int, int AssignStartingPlots:CustomOverride(ResourceType resource_)
int, int, int, int AssignStartingPlots:GetIndicesForLuxuryType(ResourceType resource_)
ResourceType, ResourceType, ResourceType, ResourceType, ResourceType, ResourceType AssignStartingPlots:GetMajorStrategicResourceQuantityValues()
ResourceType, ResourceType, ResourceType, ResourceType, ResourceType, ResourceType AssignStartingPlots:GetSmallStrategicResourceQuantityValues()
int AssignStartingPlots:PlaceSpecificNumberOfResources(ResourceType resource_, ResourceType quantity, int amount, float ratio, int impact_table_number, int min_radius, int max_radius, table(int => PlayerID) plot_list)
AssignStartingPlots:ProcessResourceList(int frequency, int impact_table_number, table(int => int) plot_list, table(int => table(int => ResourceType)) resources_to_place)
Button:RegisterCallback(MouseType lClick, (void func(HandicapType index, ResourceType y, Button button, int x, int y)) OnEndTurnTimerClicked)
ResourceType City:GetResourceDemanded(bool arg0 = nil)
int City:GetResourceYieldRateModifier(YieldType index, ResourceType resource)
ResourceType City:GetX()
ResourceType City:GetY()
bool City:IsHasResourceLocal(ResourceType resource)
bool City:SetResourceDemanded(ResourceType resource)
Deal:AddCityTrade(PlayerID player, ResourceType city)
Deal:AddDefensivePact(PlayerID us, ResourceType dealDuration)
Deal:AddGoldPerTurnTrade(PlayerID us, int goldPerTurn, ResourceType dealDuration)
Deal:AddOpenBorders(PlayerID us, ResourceType dealDuration)
Deal:AddResearchAgreement(PlayerID us, ResourceType dealDuration)
Deal:AddResourceTrade(PlayerID us, ResourceType resource, int amount, ResourceType dealDuration)
Deal:AddTradeAgreement(PlayerID us, ResourceType dealDuration)
Deal:ChangeGoldPerTurnTrade(PlayerID us, int goldPerTurn, ResourceType dealDuration)
Deal:ChangeResourceTrade(PlayerID us, ResourceType resource, int numResource, ResourceType dealDuration)
TradeableItemType, unknown, unknown, ResourceType, int, PlayerID Deal:GetNextItem()
int Deal:GetNumResource(PlayerID us, ResourceType resType)
int Deal:IsPossibleToTradeItem(PlayerID us, PlayerID them, TradeableItemType tradeType, TeamID dealDuration, ResourceType dealDuration = nil)
Deal:RemoveResourceTrade(ResourceType resource)
EditBox:SetVoid2(ResourceType arg0)
Events.RequestYieldDisplay(YieldDisplayType type, ResourceType arg1 = nil, ResourceType gridX = nil, int gridY = nil)
Events.SerialEventRawResourceIconCreated(float hexPosX, int hexPosY, unknown ImprovementType, ResourceType ResourceType)
Events.SpawnArrowEvent(ResourceType arg0, ResourceType arg1, int hexX, int hexY)
ResourceType Game.GetDealDuration()
int Game.GetNumResourceRequiredForUnit(UnitType unit, ResourceType resource)
ResourceUsageType Game.GetResourceUsageType(ResourceType resourceLoop)
GameEvents.CityCaptureComplete(PlayerID player, int capital, ResourceType x, ResourceType y, PlayerID newPlayer, int conquest, int conquest)
Grid:RegisterCallback(MouseType thisEvent, (void func(PlayerID void1, ResourceType void2, Button button)) OnContinueButtonClicked)
Grid:SetVoid2(ResourceType numFreeTechs)
Grid:SetVoids(TechType void1, ResourceType void2)
GridButton:RegisterCallback(MouseType arg0, (void func(PolicyType Id, ResourceType none, Button control)) OnEndTurnClicked)
GridButton:SetVoids(ResourceType building, ResourceType addToList)
int Map.GetNumResources(ResourceType resource)
int Map.GetNumResourcesOnLand(ResourceType resource)
ResourceType Map.GetRandomResourceQuantity(ResourceType resource)
Network.SendResearch(PlayerID tech, ResourceType discover, int value, bool arg3 = nil)
Player:ChangeNumResourceTotal(ResourceType resource, int change)
int Player:GetHappinessFromLuxury(ResourceType resource)
ResourceType Player:GetNumFreeTechs()
int Player:GetNumResourceAvailable(ResourceType resource, bool includeImport)
int Player:GetNumResourceTotal(ResourceType resource, bool includeImport)
int Player:GetNumResourceUsed(ResourceType resource)
int Player:GetResourceExport(ResourceType resource)
int Player:GetResourceFromMinors(ResourceType resource)
int Player:GetResourceImport(ResourceType resource)
Unit Player:InitUnit(UnitType unit, ResourceType x, ResourceType y, UnitAIType unitAI = NO_UNITAI, DirectionType facingDirection = NO_DIRECTION)
bool Plot:CanHaveResource(ResourceType resource, bool ignoreLatitude)
ResourceType Plot:GetNonObsoleteResourceType(TeamID team)
ResourceType Plot:GetResourceType(TeamID team)
Plot:SetResourceType(int newValue, ResourceType numResource)
ResourceType Slider:GetVoid2()
int Unit:GetNumResourceNeededToUpgrade(ResourceType resourceLoop)
ResourceType Unit:GetX()
ResourceType Unit:GetY()



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.