DCAtomicField

from panda3d.direct import DCAtomicField
class DCAtomicField

Bases:

Bases: DCField

A single atomic field of a Distributed Class, as read from a .dc file. This defines an interface to the Distributed Class, and is always implemented as a remote procedure method.

Inheritance diagram

Inheritance diagram of DCAtomicField

get_element(n: int) DCParameter

Returns the parameter object describing the nth element.

get_element_default(n: int) bytes

Returns the pre-formatted default value associated with the nth element of the field. This is only valid if has_element_default() returns true, in which case this string represents the bytes that should be assigned to the field as a default value.

If the element is an array-type element, the returned value will include the two-byte length preceding the array data.

Deprecated: use get_element() instead.

get_element_divisor(n: int) int

Returns the divisor associated with the nth element of the field. This implements an implicit fixed-point system; floating-point values are to be multiplied by this value before encoding into a packet, and divided by this number after decoding.

This method is deprecated; use get_element()->get_divisor() instead.

get_element_name(n: int) str

Returns the name of the nth element of the field. This name is strictly for documentary purposes; it does not generally affect operation. If a name is not specified, this will be the empty string.

Deprecated: use get_element()->get_name() instead.

get_element_type(n: int) DCSubatomicType

Returns the numeric type of the nth element of the field. This method is deprecated; use get_element() instead.

get_num_elements() int

Returns the number of elements (parameters) of the atomic field.

has_element_default(n: int) bool

Returns true if the nth element of the field has a default value specified, false otherwise.

Deprecated: use get_element() instead.