DCClass

from panda3d.direct import DCClass
class DCClass

Bases:

Bases: DCDeclaration

Defines a particular DistributedClass as read from an input .dc file.

Inheritance diagram

Inheritance diagram of DCClass

ai_format_generate(distobj: object, do_id: int, parent_id: int, zone_id: int, district_channel_id: int, from_channel_id: int, optional_fields: object) panda3d.core.Datagram
ai_format_update(field_name: str, do_id: int, to_id: int, from_id: int, args: object) panda3d.core.Datagram
ai_format_update_msg_type(field_name: str, do_id: int, to_id: int, from_id: int, msg_type: int, args: object) panda3d.core.Datagram
client_format_generate_CMU(distobj: object, do_id: int, zone_id: int, optional_fields: object) panda3d.core.Datagram
client_format_update(field_name: str, do_id: int, args: object) panda3d.core.Datagram
direct_update(distobj: object, field_name: str, datagram: panda3d.core.Datagram)
direct_update(distobj: object, field_name: str, value_blob: bytes)
get_class_def() object
get_constructor() DCField

Returns the constructor method for this class if it is defined, or NULL if the class uses the default constructor.

get_dc_file() DCFile

Returns the DCFile object that contains the class.

get_field(n: int) DCField

Returns the nth field in the class. This is not necessarily the field with index n; this is the nth field defined in the class directly, ignoring inheritance.

get_field_by_index(index_number: int) DCField

Returns a pointer to the DCField that has the indicated index number. If the numbered field is not found in the current class, the parent classes will be searched, so the value returned may not actually be a field within this class. Returns NULL if there is no such field defined.

get_field_by_name(name: str) DCField

Returns a pointer to the DCField that shares the indicated name. If the named field is not found in the current class, the parent classes will be searched, so the value returned may not actually be a field within this class. Returns NULL if there is no such field defined.

get_inherited_field(n: int) DCField

Returns the nth field field in the class and all of its ancestors.

This used to be the same thing as get_field_by_index(), back when the fields were numbered sequentially within a class’s inheritance hierarchy. Now that fields have a globally unique index number, this is no longer true.

get_name() str

Returns the name of this class.

get_num_fields() int

Returns the number of fields defined directly in this class, ignoring inheritance.

get_num_inherited_fields() int

Returns the total number of field fields defined in this class and all ancestor classes.

get_num_parents() int

Returns the number of base classes this class inherits from.

get_number() int

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

get_owner_class_def() object
get_parent(n: int) DCClass

Returns the nth parent class this class inherits from.

has_class_def() bool
has_constructor() bool

Returns true if this class has a constructor method, false if it just uses the default constructor.

has_owner_class_def() bool
inherits_from_bogus_class() bool

Returns true if this class, or any class in the inheritance heirarchy for this class, is a “bogus” class–a forward reference to an as-yet-undefined class.

is_bogus_class() bool

Returns true if the class has been flagged as a bogus class. This is set for classes that are generated by the parser as placeholder for missing classes, as when reading a partial file; it should not occur in a normal valid dc file.

is_struct() bool

Returns true if the class has been identified with the “struct” keyword in the dc file, false if it was declared with “dclass”.

output(out: panda3d.core.ostream)

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

pack_required_field(packer: DCPacker, distobj: object, field: DCField) bool
pack_required_field(datagram: panda3d.core.Datagram, distobj: object, field: DCField) bool
receive_update(distobj: object, di: panda3d.core.DatagramIterator)
receive_update_all_required(distobj: object, di: panda3d.core.DatagramIterator)
receive_update_broadcast_required(distobj: object, di: panda3d.core.DatagramIterator)
receive_update_broadcast_required_owner(distobj: object, di: panda3d.core.DatagramIterator)
receive_update_other(distobj: object, di: panda3d.core.DatagramIterator)
set_class_def(class_def: object)
set_owner_class_def(owner_class_def: object)
start_generate()

Starts the PStats timer going on the “generate” task, that is, marks the beginning of the process of generating a new object, for the purposes of timing this process.

This should balance with a corresponding call to stop_generate().

stop_generate()

Stops the PStats timer on the “generate” task. This should balance with a preceding call to start_generate().