https://modiki.civfanatics.com/index.php?title=CoopWarState_(Civ5_Type)&feed=atom&action=historyCoopWarState (Civ5 Type) - Revision history2024-03-29T09:13:46ZRevision history for this page on the wikiMediaWiki 1.38.2https://modiki.civfanatics.com/index.php?title=CoopWarState_(Civ5_Type)&diff=10088&oldid=prevDonQuich: Bot update2012-09-19T14:40:31Z<p>Bot update</p>
<p><b>New page</b></p><div>{{Civ5 API Beta Banner}}<br />
''This page is a part of the [[Lua and UI Reference (Civ5)]].''<br/><br />
<br />
<br />
<br />
{{TypeInfos5|ID.png|The <code>CoopWarState</code> pseudo-type is actually a regular '''integer'''. Pseudo-types do not exist in Lua, they only serve a documentation purpose on the wiki!<br />
* {{Lua}} Integers labeled as <code>CoopWarState</code> corresponds to the constants defined in the '''CoopWarStates''' Lua enumeration.<br />
}}<br />
<br />
<br />
= Lua: the CoopWarStates enumeration =<br />
Firaxis provides a Lua enumeration named <code>CoopWarStates</code>. This is just a regular global table. Its keys are the constants' names and the pairs the corresponding values.<br />
<br />
<br/>Below are the values found in this enumeration.<br />
<code><br />
{|<br />
|-<br />
!align="left" |Key<br />
!<br />
!align="left" |Value <br />
|-<br />
|align="left" |"NO_COOP_WAR_STATE"<br />
|<br />
|align="right" |-1<br />
|-<br />
|align="left" |"COOP_WAR_STATE_REJECTED"<br />
|<br />
|align="right" |0<br />
|-<br />
|align="left" |"COOP_WAR_STATE_SOON"<br />
|<br />
|align="right" |1<br />
|-<br />
|align="left" |"COOP_WAR_STATE_ACCEPTED"<br />
|<br />
|align="right" |2<br />
|-<br />
|align="left" |"NUM_COOP_WAR_STATES"<br />
|<br />
|align="right" |3<br />
|}</code><br />
<br />
<br />
= Examples =<br />
Here is how to use the LUA enumeration to retrieve the ''ID'' from the ''type''. Those examples will return and assign the integer value 0.<br />
<syntaxhighlight lang="lua" class="civ5-example"><br />
local id = CoopWarStates.COOP_WAR_STATE_REJECTED<br />
local id = CoopWarStates["COOP_WAR_STATE_REJECTED"]<br />
</syntaxhighlight><br />
<br />
<br />
=Used by=<br />
{|cellspacing="4" cellpadding="0" width="100%" style="background-color:#F0F0F0"<br />
<!-- <br />
GETCOOPWARACCEPTEDSTATE<br />
--><br />
|-<br />
|align="right" width="200" |<code>{{Type5|CoopWarState}}</code><br />
|style="padding-left:6px" |<code>{{Type5|Player}}:{{Func5|Player|GetCoopWarAcceptedState}}<b>(</b>{{Type5|PlayerID}} withPlayer, {{Type5|PlayerID}} againstPlayer<b>)</b></code><br />
|}<br />
<br />
<br />
<br />
<br />
{{Civ5 API Footer}}<br />
[[Category:Civ5 Types|CoopWarState]]</div>DonQuich