Panda3D
Public Member Functions | List of all members
Enum Class Reference

Public Member Functions

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

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__()

def __init__ (   self,
  items,
  start = 0 
)

Member Function Documentation

◆ __contains__()

def __contains__ (   self,
  value 
)

◆ __iter__()

def __iter__ (   self)

◆ __len__()

def __len__ (   self)

◆ copyTo()

def copyTo (   self,
  obj 
)

◆ fromString()

def fromString (   self,
  string 
)

◆ getString()

def getString (   self,
  value 
)

◆ hasString()

def hasString (   self,
  string 
)