TestMembership (Civ5 API)

From Civilization Modding Wiki
Jump to navigationJump to search

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


Function.png This function is a global function. Use: include("MapmakerUtilities.lua")


Usage

int TestMembership(table(int => PlayerID) table, PlayerID value)


Returned Value

No description available.

Parameters

table: No description available.
value: No description available.


Source code samples

Redundant occurences have been removed.

Amazon_XP.lua (G&K)

DLC/Expansion/Maps/Amazon_XP.lua
1037
local test = TestMembership(self.resourceIDs_assigned_to_regions, res_ID)
1038
if self.iNumTypesAssignedToRegions < self.iNumMaxAllowedForRegions or test == true then -- Not a new type that would exceed number of allowed types, so continue.
1071
local test = TestMembership(self.resourceIDs_assigned_to_regions, res_ID)
1072
if self.iNumTypesAssignedToRegions < self.iNumMaxAllowedForRegions or test == true then -- Won't exceed allowed types.
1160
local already_assigned = TestMembership(self.resourceIDs_assigned_to_regions, resource_ID)
1161
if not already_assigned then
1174
local test = TestMembership(self.resourceIDs_assigned_to_regions, res_ID)
1175
if test == false then
1227
local test1 = TestMembership(self.resourceIDs_assigned_to_regions, res_ID)
1228
local test2 = TestMembership(self.resourceIDs_assigned_to_cs, res_ID)
1229
if test1 == false and test2 == false then


AssignStartingPlots.lua (G&K)

DLC/Expansion/Gameplay/Lua/AssignStartingPlots.lua
1558
if TestMembership(land_area_IDs, iArea) == false then -- This plot is the first detected in its AreaID.
1617
if TestMembership(fertility_value_list, interim_table[tableConstructionLoop]) == true then
1690
if TestMembership(inhabitedAreaIDs, bestRemainingArea) == false then
6153
if TestMembership(areas_inhabited_by_civs, region_areaID) == false then
6197
if TestMembership(areas_inhabited_by_civs, areaID) == true then
6210
if TestMembership(areas_uninhabited, areaID) == true then


MapmakerUtilities.lua

Gameplay/Lua/MapmakerUtilities.lua
0073
local bCheckTeamList = TestMembership(teams_with_major_civs, teamID)
0074
if bCheckTeamList == false then
0490
local bTest = TestMembership(priorityRegionIDs, region_type);
0509
local bTest = TestMembership(avoidRegionIDs, region_type);



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.