Panda3D
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Enum Class Reference

Public Member Functions

 __init__ (self, items, start=0)
 
 __contains__ (self, value)
 
 __iter__ (self)
 
 __len__ (self)
 
 copyTo (self, obj)
 
 fromString (self, string)
 
 getString (self, value)
 
 hasString (self, string)
 

Protected Member Functions

 _checkExistingMembers (self, items)
 
 _checkValidIdentifier (item)
 

Protected Attributes

 _stringTable
 

Static Protected Attributes

 _checkValidIdentifier = staticmethod(_checkValidIdentifier)
 

Detailed Description

Pass in list of strings or string of comma-separated strings.
Items are accessible as instance.item, and are assigned unique,
increasing integer values. Pass in integer for 'start' to override
starting value.

Example:

>>> colors = Enum('red, green, blue')
>>> colors.red
0
>>> colors.green
1
>>> colors.blue
2
>>> colors.getString(colors.red)
'red'

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
items,
start = 0 )

Member Function Documentation

◆ __contains__()

__contains__ ( self,
value )

◆ __iter__()

__iter__ ( self)

◆ __len__()

__len__ ( self)

◆ _checkExistingMembers()

_checkExistingMembers ( self,
items )
protected

◆ _checkValidIdentifier()

_checkValidIdentifier ( item)
protected

◆ copyTo()

copyTo ( self,
obj )

◆ fromString()

fromString ( self,
string )

◆ getString()

getString ( self,
value )

◆ hasString()

hasString ( self,
string )

Member Data Documentation

◆ _checkValidIdentifier

_checkValidIdentifier = staticmethod(_checkValidIdentifier)
staticprotected

◆ _stringTable

_stringTable
protected