DCSwitch
from panda3d.direct import DCSwitch
- class DCSwitch
Bases:
Bases:
DCDeclaration
This represents a switch statement, which can appear inside a class body and represents two or more alternative unpacking schemes based on the first field read.
Inheritance diagram
- get_case(n: int) DCPackerInterface
Returns the
DCPackerInterface
that packs the nth case.
- get_case_by_value(case_value: bytes) int
Returns the index number of the case with the indicated packed value, or -1 if no case has this value.
- get_default_case() DCPackerInterface
Returns the
DCPackerInterface
that packs the default case, or NULL if there is no default case.
- get_field_by_name(case_index: int, name: str) DCField
Returns the field with the given name from the indicated case, or NULL if no field has this name.
- get_key_parameter() DCField
Returns the key parameter on which the switch is based. The value of this parameter in the record determines which one of the several cases within the switch will be used.