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

Inheritance diagram of DCField

aiFormatUpdate(do_id: int, to_id: int, from_id: int, args: object) panda3d.core.Datagram

Generates a datagram containing the message necessary to send an update for the indicated distributed object from the AI.

aiFormatUpdateMsgType(do_id: int, to_id: int, from_id: int, msg_type: int, args: object) panda3d.core.Datagram

Generates a datagram containing the message necessary to send an update, with the msg type, for the indicated distributed object from the AI.

asAtomicField() DCAtomicField

Returns the same field pointer converted to an atomic field pointer, if this is in fact an atomic field; otherwise, returns NULL.

asAtomicField() DCAtomicField

Returns the same field pointer converted to an atomic field pointer, if this is in fact an atomic field; otherwise, returns NULL.

asField() DCField
asField() DCField
asMolecularField() DCMolecularField

Returns the same field pointer converted to a molecular field pointer, if this is in fact a molecular field; otherwise, returns NULL.

asMolecularField() DCMolecularField

Returns the same field pointer converted to a molecular field pointer, if this is in fact a molecular field; otherwise, returns NULL.

asParameter() DCParameter
asParameter() DCParameter
clientFormatUpdate(do_id: int, args: object) panda3d.core.Datagram

Generates a datagram containing the message necessary to send an update for the indicated distributed object from the client.

formatData(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.

getClass() DCClass

Returns the DCClass pointer for the class that contains this field.

getDefaultValue() bytes

Returns the default value for this field. If a default value has been explicitly set (e.g. hasDefaultValue() returns true), returns that value; otherwise, returns an implicit default for the field.

getNumber() int

Returns a unique index number associated with this field. This is defined implicitly when the .dc file(s) are read.

hasDefaultValue() bool

Returns true if a default value has been explicitly established for this field, false otherwise.

isAirecv() bool

Returns true if the “airecv” flag is set for this field, false otherwise.

isBogusField() 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.

isBroadcast() bool

Returns true if the “broadcast” flag is set for this field, false otherwise.

isClrecv() bool

Returns true if the “clrecv” flag is set for this field, false otherwise.

isClsend() bool

Returns true if the “clsend” flag is set for this field, false otherwise.

isDb() bool

Returns true if the “db” flag is set for this field, false otherwise.

isOwnrecv() bool

Returns true if the “ownrecv” flag is set for this field, false otherwise.

isOwnsend() bool

Returns true if the “ownsend” flag is set for this field, false otherwise.

isRam() bool

Returns true if the “ram” flag is set for this field, false otherwise.

isRequired() bool

Returns true if the “required” flag is set for this field, false otherwise.

output(out: panda3d.core.ostream)

Write a string representation of this instance to <out>.

packArgs(packer: DCPacker, sequence: object) bool

Packs the Python arguments from the indicated tuple into the packer. Returns true on success, false on failure.

It is assumed that the packer is currently positioned on this field.

parseString(formatted_string: str) bytes

Given a human-formatted string (for instance, as returned by formatData(), 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.

receiveUpdate(packer: DCPacker, distobj: object)

Extracts the update message out of the datagram and applies it to the indicated object by calling the appropriate method.

unpackArgs(packer: DCPacker) object

Unpacks the values from the packer, beginning at the current point in the unpack_buffer, into a Python tuple and returns the tuple.

It is assumed that the packer is currently positioned on this field.

validateRanges(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>.