from panda3d.direct import DCSwitch
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.
getCaseByValue(case_value: bytes) → int¶
Returns the index number of the case with the indicated packed value, or -1 if no case has this value.
getDefaultCase() → DCPackerInterface¶
DCPackerInterfacethat packs the default case, or NULL if there is no default case.
getFieldByName(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.
getKeyParameter() → 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.
getNumCases() → int¶
Returns the number of different cases within the switch. The legal values for case_index range from 0 to