HasPolicy: Difference between revisions

From Civilization Modding Wiki
Jump to navigationJump to search
(Created page with "==Description== Returns true if a player has a specified policy. ==Example== function hasPolicy(pPlayer, policyType) for policy in GameInfo.Policies() do if policy.Type ...")
(No difference)

Revision as of 04:56, 17 February 2012

Description

Returns true if a player has a specified policy.

Example

 function hasPolicy(pPlayer, policyType)
 	for policy in GameInfo.Policies() do
 		if policy.Type == policyType then
 			return pPlayer:HasPolicy(policy.ID);
 		end
 	end
 	return false;
 end