DCField
from panda3d.direct import DCField
- class DCField
Bases:
Bases:
DCPackerInterface
,DCKeywordList
A single field of a Distributed Class, either atomic or molecular.
Inheritance diagram
- ai_format_update_msg_type(do_id: int, to_id: int, from_id: int, msg_type: int, args: object) panda3d.core.Datagram
- as_atomic_field() DCAtomicField
Returns the same field pointer converted to an atomic field pointer, if this is in fact an atomic field; otherwise, returns NULL.
- as_atomic_field() DCAtomicField
Returns the same field pointer converted to an atomic field pointer, if this is in fact an atomic field; otherwise, returns NULL.
- as_field() DCField
- as_molecular_field() DCMolecularField
Returns the same field pointer converted to a molecular field pointer, if this is in fact a molecular field; otherwise, returns NULL.
- as_molecular_field() DCMolecularField
Returns the same field pointer converted to a molecular field pointer, if this is in fact a molecular field; otherwise, returns NULL.
- as_parameter() DCParameter
- as_parameter() DCParameter
- client_format_update(do_id: int, args: object) panda3d.core.Datagram
- format_data(packed_data: bytes, show_field_names: bool) str
Given a blob that represents the packed data for this field, returns a string formatting it for human consumption. Returns empty string if there is an error.
- get_default_value() bytes
Returns the default value for this field. If a default value has been explicitly set (e.g.
has_default_value()
returns true), returns that value; otherwise, returns an implicit default for the field.
- get_number() int
Returns a unique index number associated with this field. This is defined implicitly when the .dc file(s) are read.
- has_default_value() bool
Returns true if a default value has been explicitly established for this field, false otherwise.
- is_bogus_field() bool
Returns true if the field has been flagged as a bogus field. This is set for fields that are generated by the parser as placeholder for missing fields, as when reading a partial file; it should not occur in a normal valid dc file.
- output(out: panda3d.core.ostream)
Write a string representation of this instance to <out>.
- parse_string(formatted_string: str) bytes
Given a human-formatted string (for instance, as returned by
format_data()
, above) that represents the value of this field, parse the string and return the corresponding packed data. Returns empty string if there is an error.
- validate_ranges(packed_data: bytes) bool
Verifies that all of the packed values in the field data are within the specified ranges and that there are no extra bytes on the end of the record. Returns true if all fields are valid, false otherwise.
- write(out: panda3d.core.ostream, indent_level: int)
Write a string representation of this instance to <out>.