ClassDB
A class information repository.
ClassDB.swift:17class ClassDB
Provides access to metadata stored for every available class.
Superclasses
class Object
Base class for all other classes in the engine.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
static func canInstantiate(class: StringName
) -> Bool Returns
true
if objects can be instantiated from the specifiedclass
, otherwise returnsfalse
.static func classExists(class: StringName
) -> Bool Returns whether the specified
class
is available or not.static func classGetEnumConstants(class: StringName, enum: StringName, noInheritance: Bool
) -> PackedStringArray Returns an array with all the keys in
enum
ofclass
or its ancestry.static func classGetEnumList(class: StringName, noInheritance: Bool
) -> PackedStringArray Returns an array with all the enums of
class
or its ancestry.static func classGetIntegerConstant(class: StringName, name: StringName
) -> Int Returns the value of the integer constant
name
ofclass
or its ancestry. Always returns 0 when the constant could not be found.static func classGetIntegerConstantEnum(class: StringName, name: StringName, noInheritance: Bool
) -> StringName Returns which enum the integer constant
name
ofclass
or its ancestry belongs to.static func classGetIntegerConstantList(class: StringName, noInheritance: Bool
) -> PackedStringArray Returns an array with the names all the integer constants of
class
or its ancestry.static func classGetMethodArgumentCount(class: StringName, method: StringName, noInheritance: Bool
) -> Int32 Returns the number of arguments of the method
method
ofclass
or its ancestry ifnoInheritance
isfalse
.static func classGetMethodList(class: StringName, noInheritance: Bool
) -> VariantCollection<GDictionary> Returns an array with all the methods of
class
or its ancestry ifnoInheritance
isfalse
. Every element of the array is aGDictionary
with the following keys:args
,default_args
,flags
,id
,name
,return: (class_name, hint, hint_string, name, type, usage)
.static func classGetProperty(object: Object?, property: StringName
) -> Variant Returns the value of
property
ofobject
or its ancestry.static func classGetPropertyDefaultValue(class: StringName, property: StringName
) -> Variant Returns the default value of
property
ofclass
or its ancestor classes.static func classGetPropertyList(class: StringName, noInheritance: Bool
) -> VariantCollection<GDictionary> Returns an array with all the properties of
class
or its ancestry ifnoInheritance
isfalse
.static func classGetSignal(class: StringName, signal: StringName
) -> GDictionary Returns the
signal
data ofclass
or its ancestry. The returned value is aGDictionary
with the following keys:args
,default_args
,flags
,id
,name
,return: (class_name, hint, hint_string, name, type, usage)
.static func classGetSignalList(class: StringName, noInheritance: Bool
) -> VariantCollection<GDictionary> Returns an array with all the signals of
class
or its ancestry ifnoInheritance
isfalse
. Every element of the array is aGDictionary
as described inclassGetSignal(`class`:signal:)
.static func classHasEnum(class: StringName, name: StringName, noInheritance: Bool
) -> Bool Returns whether
class
or its ancestry has an enum calledname
or not.static func classHasIntegerConstant(class: StringName, name: StringName
) -> Bool Returns whether
class
or its ancestry has an integer constant calledname
or not.static func classHasMethod(class: StringName, method: StringName, noInheritance: Bool
) -> Bool Returns whether
class
(or its ancestry ifnoInheritance
isfalse
) has a method calledmethod
or not.static func classHasSignal(class: StringName, signal: StringName
) -> Bool Returns whether
class
or its ancestry has a signal calledsignal
or not.static func classSetProperty(object: Object?, property: StringName, value: Variant
) -> GodotError Sets
property
value ofobject
tovalue
.static func getClassList(
) -> PackedStringArray Returns the names of all the classes available.
static func getInheritersFromClass(StringName
) -> PackedStringArray Returns the names of all the classes that directly or indirectly inherit from
class
.static func getParentClass(StringName
) -> StringName Returns the parent class of
class
.static func instantiate(class: StringName
) -> Variant Creates an instance of
class
.static func isClassEnabled(class: StringName
) -> Bool Returns whether this
class
is enabled or not.static func isClassEnumBitfield(class: StringName, enum: StringName, noInheritance: Bool
) -> Bool Returns whether
class
(or its ancestor classes ifnoInheritance
isfalse
) has an enum calledenum
that is a bitfield.static func isParentClass(StringName, inherits: StringName
) -> Bool Returns whether
inherits
is an ancestor ofclass
or not.class var godotClassName: StringName