ClassDB

package
v0.0.0-...-029f470 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package ClassDB provides methods for working with ClassDB object instances.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Advanced

func Advanced() class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

func CanInstantiate

func CanInstantiate(class_ string) bool

Returns [code]true[/code] if objects can be instantiated from the specified [param class], otherwise returns [code]false[/code].

func ClassExists

func ClassExists(class_ string) bool

Returns whether the specified [param class] is available or not.

func ClassGetEnumConstants

func ClassGetEnumConstants(class_ string, enum string) []string

Returns an array with all the keys in [param enum] of [param class] or its ancestry.

func ClassGetEnumList

func ClassGetEnumList(class_ string) []string

Returns an array with all the enums of [param class] or its ancestry.

func ClassGetIntegerConstant

func ClassGetIntegerConstant(class_ string, name string) int

Returns the value of the integer constant [param name] of [param class] or its ancestry. Always returns 0 when the constant could not be found.

func ClassGetIntegerConstantEnum

func ClassGetIntegerConstantEnum(class_ string, name string) string

Returns which enum the integer constant [param name] of [param class] or its ancestry belongs to.

func ClassGetIntegerConstantList

func ClassGetIntegerConstantList(class_ string) []string

Returns an array with the names all the integer constants of [param class] or its ancestry.

func ClassGetMethodArgumentCount

func ClassGetMethodArgumentCount(class_ string, method string) int

Returns the number of arguments of the method [param method] of [param class] or its ancestry if [param no_inheritance] is [code]false[/code].

func ClassGetProperty

func ClassGetProperty(obj Object.Instance, property string) any

Returns the value of [param property] of [param object] or its ancestry.

func ClassGetPropertyDefaultValue

func ClassGetPropertyDefaultValue(class_ string, property string) any

Returns the default value of [param property] of [param class] or its ancestor classes.

func ClassHasEnum

func ClassHasEnum(class_ string, name string) bool

Returns whether [param class] or its ancestry has an enum called [param name] or not.

func ClassHasIntegerConstant

func ClassHasIntegerConstant(class_ string, name string) bool

Returns whether [param class] or its ancestry has an integer constant called [param name] or not.

func ClassHasMethod

func ClassHasMethod(class_ string, method string) bool

Returns whether [param class] (or its ancestry if [param no_inheritance] is [code]false[/code]) has a method called [param method] or not.

func ClassHasSignal

func ClassHasSignal(class_ string, signal string) bool

Returns whether [param class] or its ancestry has a signal called [param signal] or not.

func ClassSetProperty

func ClassSetProperty(obj Object.Instance, property string, value any) error

Sets [param property] value of [param object] to [param value].

func GetClassList

func GetClassList() []string

Returns the names of all the classes available.

func GetInheritersFromClass

func GetInheritersFromClass(class_ string) []string

Returns the names of all the classes that directly or indirectly inherit from [param class].

func GetParentClass

func GetParentClass(class_ string) string

Returns the parent class of [param class].

func Instantiate

func Instantiate(class_ string) any

Creates an instance of [param class].

func IsClassEnabled

func IsClassEnabled(class_ string) bool

Returns whether this [param class] is enabled or not.

func IsClassEnumBitfield

func IsClassEnumBitfield(class_ string, enum string) bool

Returns whether [param class] (or its ancestor classes if [param no_inheritance] is [code]false[/code]) has an enum called [param enum] that is a bitfield.

func IsParentClass

func IsParentClass(class_ string, inherits string) bool

Returns whether [param inherits] is an ancestor of [param class] or not.

Types

type PropertyInfo

type PropertyInfo struct {
	ClassName  string       `gd:"class_name"`
	Name       string       `gd:"name"`
	Hint       int          `gd:"hint"`
	HintString string       `gd:"hint_string"`
	Type       reflect.Type `gd:"type"`
	Usage      int          `gd:"usage"`
}

func ClassGetMethodList

func ClassGetMethodList(class_ string) []PropertyInfo

Returns an array with all the methods of [param class] or its ancestry if [param no_inheritance] is [code]false[/code]. Every element of the array is a [Dictionary] with the following keys: [code]args[/code], [code]default_args[/code], [code]flags[/code], [code]id[/code], [code]name[/code], [code]return: (class_name, hint, hint_string, name, type, usage)[/code]. [b]Note:[/b] In exported release builds the debug info is not available, so the returned dictionaries will contain only method names.

func ClassGetPropertyList

func ClassGetPropertyList(class_ string) []PropertyInfo

Returns an array with all the properties of [param class] or its ancestry if [param no_inheritance] is [code]false[/code].

type SignalInfo

type SignalInfo struct {
	Name        string         `gd:"name"`
	Flags       int            `gd:"flags"`
	ID          int            `gd:"id"`
	DefaultArgs []interface{}  `gd:"default_args"`
	Args        []PropertyInfo `gd:"args"`
}

func ClassGetSignal

func ClassGetSignal(class_ string, signal string) SignalInfo

Returns the [param signal] data of [param class] or its ancestry. The returned value is a [Dictionary] with the following keys: [code]args[/code], [code]default_args[/code], [code]flags[/code], [code]id[/code], [code]name[/code], [code]return: (class_name, hint, hint_string, name, type, usage)[/code].

func ClassGetSignalList

func ClassGetSignalList(class_ string) []SignalInfo

Returns an array with all the signals of [param class] or its ancestry if [param no_inheritance] is [code]false[/code]. Every element of the array is a [Dictionary] as described in [method class_get_signal].

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL