Enumeration: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
mNo edit summary
Line 3: Line 3:
Enumeration declares an enumerated type so that comparisons can be matched against the string versions of the type.
Enumeration declares an enumerated type so that comparisons can be matched against the string versions of the type.


  enumeration <enumerationname>
enumeration <enumerationname>
  {  
{
  "key1" "value1"
  "key1" "value1"
  "key2" "value2"
  "key2" "value2"
  ...etc.
  ...etc.
}
}
The code and criteria refer to enumerations with square brackets and a double colon separator, e.g.:
The code and criteria refer to enumerations with square brackets and a double colon separator, e.g.:
[enumerationname::key1]
[enumerationname::key1]

Revision as of 21:06, 7 August 2005

Stub

This article or section is a stub. You can help by expanding it.

Enumeration declares an enumerated type so that comparisons can be matched against the string versions of the type.

enumeration <enumerationname>
{
		"key1" "value1"
		"key2" "value2"
		...etc.
}

The code and criteria refer to enumerations with square brackets and a double colon separator, e.g.: [enumerationname::key1]

In response_rules.txt, enumeration is used to represent NPC States.

enumeration "NPCState"
{
	"None"		"0"
	"Idle"		"1"
	"Alert"		"2"
	"Combat"	"3"
	"Scripted"	"4"
	"PlayDead"	"5"
	"Dead"		"6"
}